]> 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)
commitddcfd4285c6989235cf5642d9d1c3cdd8d2e1f17
tree8a7b3296ab7a480c0747fe61e14bd7599c9a5a4c
parent72aeac54423a145bc38dc246a926cc16686268b3
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