All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 1/1] raid5: speedup sync_request processing
@ 2014-06-10  0:06 Eivind Sarto
  2014-06-10  1:10 ` NeilBrown
  0 siblings, 1 reply; 3+ messages in thread
From: Eivind Sarto @ 2014-06-10  0:06 UTC (permalink / raw)
  To: linux-raid; +Cc: NeilBrown

[-- Attachment #1: Type: text/plain, Size: 641 bytes --]

Ignore previous email.  Forgot to attach patch.

This is a trivial patch that improves rebuild/resync speed of raid5 arrays.
Instead of having the resync-thread handle the stripe, it now just sets STRIPE_HANDLE and
releases the stripe.  Allowing the resync-thread to return immediately and schedule more operations.

The speedup will increase with more drives in the array.  And it will increase further if additional
kworker threads are enabled.  But, it improves with just the default raid5d() running.

Note: I posted this patch a while back, but nothing happened.  Not accepted, not rejected.

Trying one more time.

-eivind

[-- Attachment #2: raid5_speedup_sync_request.patch --]
[-- Type: application/octet-stream, Size: 1247 bytes --]

Author: Eivind Sarto <esarto@fusionio.com>
Date: Mon Jun  9 16:51:26 2014

raid5: speedup sync_request processing

The raid5 sync_request() processing calls handle_stripe() within the context of
the resync-thread.  The resync-thread issues the first set of read requests
and this adds execution latency and slows down the scheduling of the next
sync_request().
The current rebuild/resync speed of raid5 is not much faster than what
rotational HDDs can sustain.
Testing the following patch on a 6-drive array, I can increase the rebuild
speed from 100 MB/s to 175 MB/s.
The sync_request() now just sets STRIPE_HANDLE and releases the stripe.  This
creates some more parallelism between the resync-thread and raid5 kernel daemon.

Signed-off-by: Eivind Sarto <esarto@fusionio.com>

Index: current/drivers/md/raid5.c
===================================================================
--- current.orig/drivers/md/raid5.c
+++ current/drivers/md/raid5.c
@@ -4425,8 +4425,8 @@ static inline sector_t sync_request(mdde
 	bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, still_degraded);
 
 	set_bit(STRIPE_SYNC_REQUESTED, &sh->state);
+	set_bit(STRIPE_HANDLE, &sh->state);
 
-	handle_stripe(sh);
 	release_stripe(sh);
 
 	return STRIPE_SECTORS;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 1/1] raid5: speedup sync_request processing
  2014-06-10  0:06 [patch 1/1] raid5: speedup sync_request processing Eivind Sarto
@ 2014-06-10  1:10 ` NeilBrown
  0 siblings, 0 replies; 3+ messages in thread
From: NeilBrown @ 2014-06-10  1:10 UTC (permalink / raw)
  To: Eivind Sarto; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 1849 bytes --]

On Mon, 9 Jun 2014 17:06:19 -0700 Eivind Sarto <eivindsarto@gmail.com> wrote:

> Ignore previous email.  Forgot to attach patch.
> 
> This is a trivial patch that improves rebuild/resync speed of raid5 arrays.
> Instead of having the resync-thread handle the stripe, it now just sets STRIPE_HANDLE and
> releases the stripe.  Allowing the resync-thread to return immediately and schedule more operations.
> 
> The speedup will increase with more drives in the array.  And it will increase further if additional
> kworker threads are enabled.  But, it improves with just the default raid5d() running.
> 
> Note: I posted this patch a while back, but nothing happened.  Not accepted, not rejected.
> 
> Trying one more time.
> 
> -eivind

I looked through my mail and found you posted much the same patch on 11th
February.
I replied as below.  You never resent (or if you did, I never got it).  You
did reply with some numbers, but that isn't the same as resubmitting the
patch with a proper description at the top.

Your new patch does mention some performance numbers in the comment so that I
a lot better.  I've applied it.

Thanks,
NeilBrown


Hi,
 thanks for the patch.
 When you include a patch as an attachment, I find it easier to work with if
 it is "text/plain" rather than "application/octet-stream".

 As your patch is justified as a performance improvement, please include
 some measurements together with a rough description of the hardware (one or
 two sentences).

 Also, the performance improvement requires that multi-threading is enabled,
 which isn't the default.  Please measure the effect of the patch when
 multi-threading not enabled.
 Maybe we should make the change you suggest be conditional on threading
 being enabled, but we can't know without numbers.

Thanks,
NeilBrown


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [patch 1/1] raid5: speedup sync_request processing
@ 2014-06-10  0:03 Eivind Sarto
  0 siblings, 0 replies; 3+ messages in thread
From: Eivind Sarto @ 2014-06-10  0:03 UTC (permalink / raw)
  To: linux-raid; +Cc: NeilBrown

This is a trivial patch that improves rebuild/resync speed of raid5 arrays.
Instead of having the resync-thread handle the stripe, it now just sets STRIPE_HANDLE and
releases the stripe.  Allowing the resync-thread to return immediately and schedule more operations.

The speedup will increase with more drives in the array.  And it will increase further if additional
kworker threads are enabled.  But, it improves with just the default raid5d() running.

Note: I posted this patch a while back, but nothing happened.  Not accepted, not rejected.

Trying one more time.

-eivind

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-10  1:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-10  0:06 [patch 1/1] raid5: speedup sync_request processing Eivind Sarto
2014-06-10  1:10 ` NeilBrown
  -- strict thread matches above, loose matches on Subject: below --
2014-06-10  0:03 Eivind Sarto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.