Message ID | 20220616191945.23935-5-logang@deltatee.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
Series | Improve Raid5 Lock Contention | expand |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 25db747c5856..969609b7114b 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -3531,8 +3531,6 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, } spin_unlock_irq(&sh->stripe_lock); - if (stripe_can_batch(sh)) - stripe_add_to_batch_list(conf, sh); return 1; overlap: @@ -5950,6 +5948,9 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi) goto retry; } + if (stripe_can_batch(sh)) + stripe_add_to_batch_list(conf, sh); + if (do_flush) { set_bit(STRIPE_R5C_PREFLUSH, &sh->state); /* we only need flush for one stripe */