linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@cse.unsw.edu.au>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-raid@vger.kernel.org
Subject: [PATCH] md - 2 of 10 - Don't allow raid5 rebuild to swamp raid5 stripe cache
Date: Fri, 16 Jan 2004 12:19:37 +1100	[thread overview]
Message-ID: <E1AhIe9-0002U2-00@notabene> (raw)


raid5 rebuild takes stripes so agressively that other
access cannot get a look-in.
With this patch, the rebuild pauses slightly if there is a 
shortage of stripes to let other processes have a chance.

 ----------- Diffstat output ------------
 ./drivers/md/raid5.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)

diff ./drivers/md/raid5.c~current~ ./drivers/md/raid5.c
--- ./drivers/md/raid5.c~current~	2004-01-16 11:58:51.000000000 +1100
+++ ./drivers/md/raid5.c	2004-01-16 11:59:17.000000000 +1100
@@ -1395,7 +1395,14 @@ static int sync_request (mddev_t *mddev,
 
 	first_sector = raid5_compute_sector(stripe*data_disks*sectors_per_chunk
 		+ chunk_offset, raid_disks, data_disks, &dd_idx, &pd_idx, conf);
-	sh = get_active_stripe(conf, sector_nr, pd_idx, 0);
+	sh = get_active_stripe(conf, sector_nr, pd_idx, 1);
+	if (sh == NULL) {
+		sh = get_active_stripe(conf, sector_nr, pd_idx, 0);
+		/* make sure we don't swamp the stripe cache if someone else
+		 * is trying to get access 
+		 */
+		yield();
+	}
 	spin_lock(&sh->lock);	
 	set_bit(STRIPE_SYNCING, &sh->state);
 	clear_bit(STRIPE_INSYNC, &sh->state);

             reply	other threads:[~2004-01-16  1:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-16  1:19 NeilBrown [this message]
2004-01-16  1:33 ` [PATCH] md - 2 of 10 - Don't allow raid5 rebuild to swamp raid5 stripe cache Andrew Morton
2004-01-16  1:43   ` Neil Brown
2004-01-16  1:55     ` Andrew Morton

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=E1AhIe9-0002U2-00@notabene \
    --to=neilb@cse.unsw.edu.au \
    --cc=akpm@osdl.org \
    --cc=linux-raid@vger.kernel.org \
    /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 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).