From: NeilBrown <neilb@suse.de>
To: Shaohua Li <shli@kernel.org>
Cc: linux-raid@vger.kernel.org
Subject: Re: [patch 1/3 v4]raid1: make sequential read detection per disk based
Date: Mon, 16 Jul 2012 14:24:52 +1000 [thread overview]
Message-ID: <20120716142452.081b43da@notabene.brown> (raw)
In-Reply-To: <20120705092031.GA27956@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1992 bytes --]
On Thu, 5 Jul 2012 17:20:31 +0800 Shaohua Li <shli@kernel.org> wrote:
> Currently the sequential read detection is global wide. It's natural to make it
> per disk based, which can improve the detection for concurrent multiple
> sequential reads. And next patch will make SSD read balance not use distance
> based algorithm, where this change help detect truly sequential read for SSD.
>
> Signed-off-by: Shaohua Li <shli@fusionio.com>
> ---
> drivers/md/raid1.c | 29 ++++++-----------------------
> drivers/md/raid1.h | 11 +++++------
> 2 files changed, 11 insertions(+), 29 deletions(-)
>
> Index: linux/drivers/md/raid1.c
> ===================================================================
> --- linux.orig/drivers/md/raid1.c 2012-07-04 11:53:32.000000000 +0800
> +++ linux/drivers/md/raid1.c 2012-07-04 15:23:51.114885573 +0800
> @@ -483,7 +483,6 @@ static int read_balance(struct r1conf *c
> const sector_t this_sector = r1_bio->sector;
> int sectors;
> int best_good_sectors;
> - int start_disk;
> int best_disk;
> int i;
> sector_t best_dist;
> @@ -503,20 +502,17 @@ static int read_balance(struct r1conf *c
> best_good_sectors = 0;
>
> if (conf->mddev->recovery_cp < MaxSector &&
> - (this_sector + sectors >= conf->next_resync)) {
> + (this_sector + sectors >= conf->next_resync))
> choose_first = 1;
> - start_disk = 0;
> - } else {
> + else
> choose_first = 0;
> - start_disk = conf->last_used;
> - }
>
> for (i = 0 ; i < conf->raid_disks * 2 ; i++) {
> sector_t dist;
> sector_t first_bad;
> int bad_sectors;
>
> - int disk = start_disk + i;
> + int disk = i;
> if (disk >= conf->raid_disks * 2)
> disk -= conf->raid_disks * 2;
You forgot the change I asked for here to make it
for (disk = 0; disk < ..... ; disk++)
but you've fixed up all the other bits nicely, so I made the above change and
have applied all three patches, thanks.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
prev parent reply other threads:[~2012-07-16 4:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-05 9:20 [patch 1/3 v4]raid1: make sequential read detection per disk based Shaohua Li
2012-07-16 4:24 ` NeilBrown [this message]
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=20120716142452.081b43da@notabene.brown \
--to=neilb@suse.de \
--cc=linux-raid@vger.kernel.org \
--cc=shli@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 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.