linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 3/3]raid5: reduce handle_stripe() called times for full stripe write
@ 2014-05-22 11:25 Shaohua Li
  0 siblings, 0 replies; only message in thread
From: Shaohua Li @ 2014-05-22 11:25 UTC (permalink / raw)
  To: linux-raid, neilb


For a full stripe write, the ideal operation order is handle_stripe_dirtying(),
raid_run_ops(), set R5_Wantwrite bit, and ops_run_io(). In this way, one
handle_stripe() will dispatch IO for the stripe, otherwise there are more extra
rounds of handle_stripe(). In a high speed raid5 array, handle_stripe()
consumes considered cpu time. Reducing its overhead has around 10% performance
boost.

Previous patch already adjusts operation order as handle_stripe_dirtying, set
R5_Wantwrite bit and ops_run_io. This one adds the missing raid_run_ops.

We have two raid_run_ops called in handle_stripe() now. There are some
dependent operations in raid_run_ops. The operations are COMPUTE_BLK, PREXOR,
BIODRAIN, RECONSTRUCT. COMPUTE_BLK is set in handle_stripe_fill and others are
set in handle_stripe_dirtying. We didn't change the order of the two routines.
PREXOR, BIODRAIN and RECONSTRUCT are set togther, so we don't need worry about
misorder of them. For async operations, the async engine will handle dependency
as before. So the new raid_run_ops just moves some operations in advance, we
don't break any order.

Signed-off-by: Shaohua Li <shli@fusionio.com>
---
 drivers/md/raid5.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux/drivers/md/raid5.c
===================================================================
--- linux.orig/drivers/md/raid5.c	2014-05-22 14:46:34.299143973 +0800
+++ linux/drivers/md/raid5.c	2014-05-22 14:47:58.742081003 +0800
@@ -3790,6 +3790,9 @@ static void handle_stripe(struct stripe_
 	if (s.to_write && !sh->reconstruct_state && !sh->check_state)
 		handle_stripe_dirtying(conf, sh, &s, disks);
 
+	if (s.ops_request)
+		raid_run_ops(sh, &s.ops_request);
+
 	/* Now we check to see if any write operations have recently
 	 * completed
 	 */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-05-22 11:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-22 11:25 [patch 3/3]raid5: reduce handle_stripe() called times for full stripe write Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).