All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eivind Sarto <eivindsarto@gmail.com>
To: linux-raid@vger.kernel.org
Cc: NeilBrown <neilb@suse.de>
Subject: [patch 1/1] raid5: speedup sync_request processing
Date: Mon, 9 Jun 2014 17:06:19 -0700	[thread overview]
Message-ID: <EC0B81A7-E03B-442F-B523-4B7154ABDC34@gmail.com> (raw)

[-- 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;

             reply	other threads:[~2014-06-10  0:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10  0:06 Eivind Sarto [this message]
2014-06-10  1:10 ` [patch 1/1] raid5: speedup sync_request processing NeilBrown
  -- strict thread matches above, loose matches on Subject: below --
2014-06-10  0:03 Eivind Sarto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EC0B81A7-E03B-442F-B523-4B7154ABDC34@gmail.com \
    --to=eivindsarto@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.