From: Andrew Morton <akpm@zip.com.au>
To: Mark Peloquin <peloquin@us.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Bio pool & scsi scatter gather pool usage
Date: Thu, 18 Apr 2002 11:57:38 -0700 [thread overview]
Message-ID: <3CBF1722.EDA8631F@zip.com.au> (raw)
In-Reply-To: <OFA8584441.22F71259-ON85256B9F.00627FAA@pok.ibm.com>
Mark Peloquin wrote:
>
> ...
> > Tell me why this won't work?
>
> This would require the BIO assembly code to make at least one
> call to find the current permissible BIO size at offset xyzzy.
> Depending on the actual IO size many foo_max_bytes calls may
> be required. Envision the LVM or RAID case where physical
> extents or chunks sizes can be as small as 8Kb I believe. For
> a 64Kb IO, its conceivable that 9 calls to foo_max_bytes may
> be required to package that IO into permissibly sized BIOs.
True. But probably the common case is not as bad as that, and
these repeated calls are probably still cheaper than allocating
and populating the redundant top-level BIO.
Also, the top-level code can be cache-friendly. The bad way
to write it would be to do:
while (more to send) {
maxbytes = bio_max_bytes(block);
build_and_send_a_bio(block, maxbytes);
block += maxbytes / whatever;
}
That creates long code paths and L1 cache thrashing. Kernel
tends to do that rather a lot in the IO paths.
The good way is:
int maxbytes[something];
int i = 0;
while (more_to_send) {
maxbytes[i] = bio_max_bytes(block);
block += maxbytes[i++] / whatever;
}
i = 0;
while (more_to_send) {
build_and_send_a_bio(block, maxbytes[i]);
block += maxbytes[i++] / whatever;
}
if you get my drift. This way the computational costs of
the second and succeeding bio_max_bytes() calls are very
small.
One thing which concerns me about the whole scheme at
present is that the uncommon case (volume managers, RAID,
etc) will end up penalising the common case - boring
old ext2 on boring old IDE/SCSI.
Right now, BIO_MAX_SECTORS is only 64k, and IDE can
take twice that. I'm not sure what the largest
request size is for SCSI - certainly 128k.
Let's not create any designed-in limitations at this
stage of the game.
-
next prev parent reply other threads:[~2002-04-18 18:57 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-18 18:23 Bio pool & scsi scatter gather pool usage Mark Peloquin
2002-04-18 18:57 ` Andrew Morton [this message]
2002-04-19 15:44 ` Denis Vlasenko
2002-04-25 19:43 ` Mike Fedyk
2002-04-25 19:56 ` Andrew Morton
2002-04-25 19:59 ` David Mansfield
-- strict thread matches above, loose matches on Subject: below --
2002-04-18 23:11 Douglas Gilbert
2002-04-18 22:58 Mark Peloquin
2002-04-18 23:36 ` Alan Cox
2002-04-18 23:48 ` Andrew Morton
2002-04-19 7:29 ` Stephen Lord
2002-04-19 8:08 ` Joe Thornber
2002-04-19 8:51 ` Alan Cox
2002-04-19 8:58 ` Alan Cox
2002-04-19 15:27 ` Steve Lord
2002-04-19 15:57 ` Alan Cox
2002-04-19 15:51 ` Rik van Riel
2002-04-22 6:50 ` Suparna Bhattacharya
2002-04-22 7:06 ` arjan
2002-04-22 7:54 ` Suparna Bhattacharya
2002-04-24 10:20 ` Helge Hafting
2002-04-19 18:15 ` Oliver Xymoron
2002-04-18 13:58 Mark Peloquin
2002-04-18 16:17 ` Andrew Morton
2002-04-18 17:35 ` 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=3CBF1722.EDA8631F@zip.com.au \
--to=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=peloquin@us.ibm.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