All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: majianpeng <majianpeng@gmail.com>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: Re: [PATCH 3/5] md: Increase the frequency of recording checkpoint of recovery.
Date: Mon, 29 Oct 2012 08:41:47 +1100	[thread overview]
Message-ID: <20121029084147.2d292bc5@notabene.brown> (raw)
In-Reply-To: <201210271028177376247@gmail.com>

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

On Sat, 27 Oct 2012 10:28:20 +0800 majianpeng <majianpeng@gmail.com> wrote:

> With the hard disk capacity of larger,the entire recovery process
> becomes longer.So it should increase the frequency.
> Supposed the speed of recovery is 100MB/s(i think for HDD is good).
> The total time of recovery 4TB hdd is about 666 minutes.So change the
> frequency from 16 to 64 times,it's about 10mins.
> 
> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
> ---
>  drivers/md/md.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 01e25bd..ba328ee 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -7446,7 +7446,7 @@ void md_do_sync(struct md_thread *thread)
>  		if (!test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) &&
>  		    ((mddev->curr_resync > mddev->curr_resync_completed &&
>  		      (mddev->curr_resync - mddev->curr_resync_completed)
> -		      > (max_sectors >> 4)) ||
> +		      > (max_sectors >> 6)) ||
>  		     (j - mddev->curr_resync_completed)*2
>  		     >= mddev->resync_max - mddev->curr_resync_completed
>  			    )) {

I don't like this - the number '6' is completely arbitrary.

The original '4' was never about number of minutes.  It was a fraction of the
total effort needed.
I wanted to make sure you only repeated at most 10% of the required effort
(one order of magnitude).  >>4 is about 6% and easy to calculate.

If you want it to be about time (which I don't object to), then make it about
time.  Keep track of the last time we updated curr_resync_completed, and if
that is more than a few minutes ago, update it again.
This is what I said last time - if you want something to be based on time,
test the time.
If 'echo idle > sync_action' doesn't work (Which it seems it doesn't), then
it is OK to just do it in the kernel.

NeilBrown

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

  reply	other threads:[~2012-10-28 21:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-27  2:28 [PATCH 3/5] md: Increase the frequency of recording checkpoint of recovery majianpeng
2012-10-28 21:41 ` NeilBrown [this message]
2012-10-29  9:24   ` majianpeng
2012-10-31  0:37     ` NeilBrown

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=20121029084147.2d292bc5@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=majianpeng@gmail.com \
    /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.