Re: [PATCH v2 03/12] md/raid5: Move stripe_add_to_batch_list() call out of add_stripe_bio()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 4/21/22 3:54 AM, Logan Gunthorpe wrote:
stripe_add_to_batch_list() is better done in the loop in make_request
instead of inside add_stripe_bio(). This is clearer and allows for
storing the batch_head state outside the loop in a subsequent patch.

The call to add_stripe_bio() in retry_aligned_read() is for read
and batching only applies to write. So it's impossible for batching
to happen at that call site.

No functional changes intended.

Signed-off-by: Logan Gunthorpe<logang@xxxxxxxxxxxx>
Reviewed-by: Christoph Hellwig<hch@xxxxxx>
---
  drivers/md/raid5.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index cda6857e6207..8e1ece5ce984 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3534,8 +3534,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:
@@ -5955,6 +5953,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 */


Reviewed-by: Guoqing Jiang <guoqing.jiang@xxxxxxxxx>

Thanks,
Guoqing



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux