]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
raid5: speedup sync_request processing
authorEivind Sarto <eivindsarto@gmail.com>
Tue, 10 Jun 2014 00:06:19 +0000 (17:06 -0700)
committerNeilBrown <neilb@suse.de>
Tue, 10 Jun 2014 01:02:01 +0000 (11:02 +1000)
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>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c

index ce421e3a3980ea1321a40f3fde8ec0a08207d595..28219fa66e73deb4cec74e62cf460920c615cb7f 100644 (file)
@@ -5074,8 +5074,8 @@ static inline sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int
        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;