On Wed, Apr 20, 2022 at 01:54:22PM -0600, Logan Gunthorpe wrote: > When batching, every stripe head has to find the previous stripe head to > add to the batch list. This involves taking the hash lock which is > highly contended during IO. > > Instead of finding the previous stripe_head each time, store a > reference to the previous stripe_head in a pointer so that it doesn't > require taking the contended lock another time. > > The reference to the previous stripe must be released before scheduling > and waiting for work to get done. Otherwise, it can hold up > raid5_activate_delayed() and deadlock. Looks good: Reviewed-by: Christoph Hellwig <hch@xxxxxx>