From: Neil Brown <neilb@suse.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] md: Use new topology calls to indicate alignment and I/O sizes
Date: Thu, 11 Jun 2009 20:25:58 +1000 [thread overview]
Message-ID: <18992.56246.663815.790604@notabene.brown> (raw)
In-Reply-To: message from Martin K. Petersen on Wednesday June 10
On Wednesday June 10, martin.petersen@oracle.com wrote:
> >>>>> "Neil" == NeilBrown <neilb@suse.de> writes:
>
> >> + blk_queue_io_opt(mddev->queue, chunk_size * (mddev->raid_disks >>
> >> blk_queue_io_opt(mddev->1));
>
> Neil> ">> 1" is wrong. A raid10 may have more than 2 copies for each
> Neil> block.
>
> I recall pondering when I wrote that. Never got around to revisiting
> the issue. Your RAID10 implementation is a bit hipper than most :)
And I know where my towel is, too :-)
>
>
> Neil> This calculation needs to be a bit more subtle and take about of
> Neil> the particular layout (near, offset, or far).
>
> Why would layout interfere with preferred I/O size?
For a 'far' or 'offset' layout, you probably want
chunksize * raid_disks
just like raid0.
For a 'near' layout, what you suggest seems good.
The driver actually allows both 'near' and 'far'. I doubt if anyone
would use it, but it would be nice to get it 'right'.
>
> How about:
>
> if (conf->raid_disks % conf->copies)
> blk_queue_io_opt(mddev->queue, chunk_size * conf->raid_disks);
> else
> blk_queue_io_opt(mddev->queue, chunk_size *
> (conf->raid_disks / conf->copies));
I think that if you replace "conf->copies" by 'nc' (which is
(mddev->layout & 255)
) then that will be perfect. For a 'far' layout, nc is normally '1',
and either branch will give the correct value.
Thanks,
NeilBrown
>
> I.e.:
>
> 2 drives, 2 copies: a1 a1 optimal I/O = 1 * chunk_size
>
> 3 drives, 2 copies: a1 a1 a2
> a2 a3 a3 optimal I/O = 3 * chunk_size
>
> 4 drives, 2 copies: a1 a1 a2 a2 optimal I/O = 2 * chunk_size
>
> 4 drives, 3 copies: a1 a1 a1 a2
> a2 a2 a3 a3
> a3 a4 a4 a4 optimal I/O = 4 * chunk_size
>
> And so on. Does that make sense? I.e. we try to keep all drives
> equally busy.
>
>
> Neil> You seem to be treating raid4 like raid6 :-)
>
> Whoops. I always forget about raid4. Fixed.
>
> --
> Martin K. Petersen Oracle Linux Engineering
> --
> 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:[~2009-06-11 10:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 4:31 [PATCH] md: Use new topology calls to indicate alignment and I/O sizes Martin K. Petersen
2009-06-09 5:02 ` NeilBrown
2009-06-10 6:47 ` Martin K. Petersen
2009-06-11 10:25 ` Neil Brown [this message]
2009-06-12 4:43 ` Martin K. Petersen
-- strict thread matches above, loose matches on Subject: below --
2009-06-23 4:54 Martin K. Petersen
2009-06-23 21:44 ` Mike Snitzer
2009-06-24 4:05 ` Neil Brown
2009-06-24 5:03 ` Martin K. Petersen
2009-06-24 6:22 ` Neil Brown
2009-06-24 17:07 ` Martin K. Petersen
2009-06-25 2:35 ` Neil Brown
2009-06-25 4:37 ` Martin K. Petersen
2009-06-25 6:16 ` Neil Brown
2009-06-25 16:24 ` Martin K. Petersen
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=18992.56246.663815.790604@notabene.brown \
--to=neilb@suse.de \
--cc=linux-raid@vger.kernel.org \
--cc=martin.petersen@oracle.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 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).