]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid5: Keep a reference to last stripe_head for batch
authorLogan Gunthorpe <logang@deltatee.com>
Thu, 16 Jun 2022 19:19:40 +0000 (13:19 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:14:42 +0000 (17:14 -0600)
commit0b16395c54eb4c5d7e9e1669873098ba87986b23
tree8a7b3296ab7a480c0747fe61e14bd7599c9a5a4c
parentac4f98f18626dc60672f76d77c1663c7f93c1848
md/raid5: Keep a reference to last stripe_head for batch

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.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/raid5.c