From: "'Keld Jørn Simonsen'" <keld@dkuug.dk>
To: Guy Watkins <linux-raid@watkins-home.com>
Cc: 'NeilBrown' <neilb@suse.de>, linux-raid@vger.kernel.org
Subject: Re: [PATCH md] Allow raid10 resync to happening in larger chunks.
Date: Thu, 7 Aug 2008 02:45:20 +0200 [thread overview]
Message-ID: <20080807004520.GC9550@rap.rap.dk> (raw)
In-Reply-To: <200808062256.m76MupNY089428@sia.dkuug.dk>
On Wed, Aug 06, 2008 at 06:56:40PM -0400, Guy Watkins wrote:
> } -----Original Message-----
> } From: linux-raid-owner@vger.kernel.org [mailto:linux-raid-
> } owner@vger.kernel.org] On Behalf Of Keld Jørn Simonsen
> } Sent: Wednesday, August 06, 2008 5:02 AM
> } To: NeilBrown
> } Cc: linux-raid@vger.kernel.org
> } Subject: Re: [PATCH md] Allow raid10 resync to happening in larger chunks.
> }
> } Neil made this patch based on my patch to speed up raid10 resync.
> }
> } It is a bit different, although it messes with exactly the two cinstants
> } that I also changed. One difference is that Neil intiatlly only allocates
> } 1 MiB for buffers while my patch allocates 32 MiB. For the patch to work
> } as intended it is essential that something like 32 MiB be available for
> } buffers. I do not see how that is done in Neil's case, but then I do not
> } know the code so well. So how does it work, Neil?
> }
> } Has your patch been tested, Neil?
> }
> } Anyway if this i a difference between 32 MiB being available or not, I
> } think it is important that it be available at the start of the process
> } and available for the whole duration of the process. Is it a concern of
> } whether 32 Mib buffers be available? My take is that if you are running
> } raid, then you probably always have quite some memory.
>
> Bad assumption! My Linux firewall/router has 64MB total and works really
> well. I have 2 disks in a RAID1.
well, well, you do not use the raid10-driver, then.
> Maybe the amount of memory could be based on a percentage of total RAM?
Anyway, if it works then Neil's patch is probably better than mine, as I
think it will aso run if 32 MiB is not availble.
Best regards
keld
> Guy
>
> }
> } best regards
> } keld
> }
> }
> } On Tue, Aug 05, 2008 at 04:17:34PM +1000, NeilBrown wrote:
> } > The raid10 resync/recovery code currently limits the amount of
> } > in-flight resync IO to 2Meg. This was copied from raid1 where
> } > it seems quite adequate. However for raid10, some layouts require
> } > a bit of seeking to perform a resync, and allowing a larger buffer
> } > size means that the seeking can be significantly reduced.
> } >
> } > There is probably no real need to limit the amount of in-flight
> } > IO at all. Any shortage of memory will naturally reduce the
> } > amount of buffer space available down to a set minimum, and any
> } > concurrent normal IO will quickly cause resync IO to back off.
> } >
> } > The only problem would be that normal IO has to wait for all resync IO
> } > to finish, so a very large amount of resync IO could cause unpleasant
> } > latency when normal IO starts up.
> } >
> } > So: increase RESYNC_DEPTH to allow 32Meg of buffer (if memory is
> } > available) which seems to be a good amount. Also reduce the amount
> } > of memory reserved as there is no need to keep 2Meg just for resync if
> } > memory is tight.
> } >
> } > Thanks to Keld for the suggestion.
> } >
> } > Cc: Keld Jørn Simonsen <keld@dkuug.dk>
> } > Signed-off-by: NeilBrown <neilb@suse.de>
> } > ---
> } > drivers/md/raid10.c | 9 +++++----
> } > 1 files changed, 5 insertions(+), 4 deletions(-)
> } >
> } > diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> } > index d41bebb..e34cd0e 100644
> } > --- a/drivers/md/raid10.c
> } > +++ b/drivers/md/raid10.c
> } > @@ -76,11 +76,13 @@ static void r10bio_pool_free(void *r10_bio, void
> } *data)
> } > kfree(r10_bio);
> } > }
> } >
> } > +/* Maximum size of each resync request */
> } > #define RESYNC_BLOCK_SIZE (64*1024)
> } > -//#define RESYNC_BLOCK_SIZE PAGE_SIZE
> } > -#define RESYNC_SECTORS (RESYNC_BLOCK_SIZE >> 9)
> } > #define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE)
> } > -#define RESYNC_WINDOW (2048*1024)
> } > +/* amount of memory to reserve for resync requests */
> } > +#define RESYNC_WINDOW (1024*1024)
> } > +/* maximum number of concurrent requests, memory permitting */
> } > +#define RESYNC_DEPTH (32*1024*1024/RESYNC_BLOCK_SIZE)
> } >
> } > /*
> } > * When performing a resync, we need to read and compare, so
> } > @@ -690,7 +692,6 @@ static int flush_pending_writes(conf_t *conf)
> } > * there is no normal IO happeing. It must arrange to call
> } > * lower_barrier when the particular background IO completes.
> } > */
> } > -#define RESYNC_DEPTH 32
> } >
> } > static void raise_barrier(conf_t *conf, int force)
> } > {
> } > --
> } > 1.5.6.3
> } --
> } To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> } the body of a message to majordomo@vger.kernel.org
> } More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2008-08-07 0:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-05 6:17 [PATCH md] 6 Little md patches for 2.6.27 for review NeilBrown
2008-08-05 6:17 ` [PATCH md] Make writes to md/safe_mode_delay immediately effective NeilBrown
2008-08-05 6:17 ` [PATCH md] Restore force switch of md array to readonly at reboot time NeilBrown
2008-08-05 6:17 ` [PATCH md] Fail safely when trying to grow an array with a write-intent bitmap NeilBrown
2008-08-05 6:17 ` [PATCH md] Don't let a blocked_rdev interfere with read request in raid5/6 NeilBrown
2008-08-05 6:17 ` [PATCH md] Allow faulty devices to be removed from a readonly array NeilBrown
2008-08-05 6:17 ` [PATCH md] Allow raid10 resync to happening in larger chunks NeilBrown
2008-08-06 9:01 ` Keld Jørn Simonsen
[not found] ` <200808062256.m76MupNY089428@sia.dkuug.dk>
2008-08-07 0:45 ` 'Keld Jørn Simonsen' [this message]
2008-08-11 0:37 ` Neil Brown
2008-08-05 18:12 ` [PATCH md] Fail safely when trying to grow an array with a write-intent bitmap Dan Williams
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=20080807004520.GC9550@rap.rap.dk \
--to=keld@dkuug.dk \
--cc=linux-raid@vger.kernel.org \
--cc=linux-raid@watkins-home.com \
--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 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).