From: "Ph. Marek" <philipp.marek@bmlv.gv.at>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Linda Walsh <lkml@tlinx.org>, Wu Fengguang <wfg@mail.ustc.edu.cn>,
linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
Jens Axboe <axboe@suse.de>, Nick Piggin <nickpiggin@yahoo.com.au>,
Badari Pulavarty <pbadari@us.ibm.com>
Subject: Re: [RFC] kernel facilities for cache prefetching
Date: Thu, 4 May 2006 09:08:09 +0200 [thread overview]
Message-ID: <200605040908.10727.philipp.marek@bmlv.gv.at> (raw)
In-Reply-To: <Pine.LNX.4.64.0605031829300.4086@g5.osdl.org>
On Thursday 04 May 2006 03:31, Linus Torvalds wrote:
> On Wed, 3 May 2006, Linda Walsh wrote:
> > > - it gives you only a very limited view into what is actually going
> > > on.
> >
> > ??? In what way? I don't think we need a *complex* view of what
> > is going on.
>
> The block-based view is a very simple one, but it's _too_ simple. It
> doesn't actually tell the user what is happening. It doesn't tell you why
> the request happened in the first place, so it leaves you no way to really
> do anything sane about it.
>
> You can't prefetch (because the indexing is wrong), and you can't actually
> even analyze it (because you don't know any background to what you're
> seeing). In short, you can't _do_ anything with it.
Please forgive me if I'm dumb, but what about the following reasoning:
The user as such (the person just *using* the computer) won't do anything
with "program xyz uses block a, b, and c.".
But it wouldn't help much if he was told "program xyz uses files a, b, and d."
That's a task for package maintainers and distributions to optimize the
*number* of accesses.
So the simple information which block numbers we need would not benefit the
users (or the distribution developers), but it's enough for caching things:
Ascending block numbers on disk can be read very fast, as the disk needs no or
less seeking. That's even true for stripes and mirrors. (I grant you that
there are complicated setups out there, but these could be handled similar.)
If we know which blocks are read (directories, inodes, data), an early
userspace application (possibly even from initrd) could
- read these blocks into a ramdisk device (linearly),
- define a device mapper as a mirror of
- the original root partition,
- and a sparse device composed from parts of the ramdisk, interleaved by
non-existing (error-producing) ranges, and
- setup the device mapper as a root device.
- In a specified point at startup the mapping device gets set to just
a linear interpretation of the root partition, and the ramdisk gets
discarded.
Example:
--------
N specifies a needed block, the numbers other blocks.
Harddisk: 1 2 3 N N N 7 8 N 10 N 12 13 14 N 16 N ...
RAM-Disk contains 4 5 6 9 11 15 17
The mirror set would look like this,
with E representing an error-returning block:
Harddisk: 1 2 3 N N N 7 8 N 10 N 12 13 14 N 16 N ...
mapped from RAM-Disk: E E E 4 5 6 E E 9 E 11 E E E 15 E 17 ...
Advantages:
- As long as there's a good chance that the needed blocks are read from the
ramdisk (which was filled linearly, with 20-60MB/sec as reported by others),
*all* disk-access times (inodes, directories, data) should be nearly zero.
Of course, there will be blocks which have now to be read which weren't
needed the last boot, which will have to be taken from the harddisk,
but the majority should be taken from the ramdisk.
Problems:
- We'd need to define a priority in the mirror set, so that *everything*
possible is taken from the ramdisk
- There has to be a way to *not* disable the ram-disk when an error-block is
read.
That's completely doable in userspace (except for knowing which blocks have to
be read), and doesn't sound like much overhead to me.
Suggestions, ideas?
Does that work? Does it not?
Regards,
Phil
next prev parent reply other threads:[~2006-05-04 7:10 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060502075049.GA5000@mail.ustc.edu.cn>
2006-05-02 7:50 ` Wu Fengguang
2006-05-02 12:46 ` Diego Calleja
[not found] ` <20060502144203.GA10594@mail.ustc.edu.cn>
2006-05-02 14:42 ` Wu Fengguang
2006-05-02 16:07 ` Diego Calleja
[not found] ` <20060503064503.GA4781@mail.ustc.edu.cn>
2006-05-03 6:45 ` Wu Fengguang
2006-05-03 18:14 ` Diego Calleja
2006-05-03 23:39 ` Zan Lynx
2006-05-04 1:37 ` Diego Calleja
2006-05-02 15:55 ` Linus Torvalds
2006-05-02 16:35 ` Andi Kleen
[not found] ` <20060503071325.GC4781@mail.ustc.edu.cn>
2006-05-03 7:13 ` Wu Fengguang
2006-05-03 12:59 ` Nikita Danilov
[not found] ` <20060503041106.GC5915@mail.ustc.edu.cn>
2006-05-03 4:11 ` Wu Fengguang
2006-05-03 17:28 ` Badari Pulavarty
[not found] ` <346733486.30800@ustc.edu.cn>
2006-05-04 15:03 ` Linus Torvalds
2006-05-04 16:57 ` Badari Pulavarty
[not found] ` <20060505144451.GA6134@mail.ustc.edu.cn>
2006-05-05 14:44 ` Wu Fengguang
2006-05-03 22:20 ` Rik van Riel
[not found] ` <20060506011125.GA9099@mail.ustc.edu.cn>
2006-05-06 1:11 ` Wu Fengguang
2006-05-04 0:28 ` Linda Walsh
2006-05-04 1:31 ` Linus Torvalds
2006-05-04 7:08 ` Ph. Marek [this message]
2006-05-04 7:33 ` Arjan van de Ven
[not found] ` <20060504121454.GB6008@mail.ustc.edu.cn>
2006-05-04 12:14 ` Wu Fengguang
2006-05-04 12:34 ` Arjan van de Ven
2006-05-03 21:45 ` Linda Walsh
[not found] ` <20060504121212.GA6008@mail.ustc.edu.cn>
2006-05-04 12:12 ` Wu Fengguang
2006-05-04 18:57 ` Linda Walsh
[not found] ` <20060505152007.GB6134@mail.ustc.edu.cn>
2006-05-05 15:20 ` Wu Fengguang
2006-05-04 9:02 ` Helge Hafting
2006-05-02 7:58 ` Arjan van de Ven
[not found] ` <20060502080619.GA5406@mail.ustc.edu.cn>
2006-05-02 8:06 ` Wu Fengguang
2006-05-02 8:30 ` Arjan van de Ven
[not found] ` <20060502085325.GA9190@mail.ustc.edu.cn>
2006-05-02 8:53 ` Wu Fengguang
2006-05-06 6:49 ` Denis Vlasenko
2006-05-02 8:55 ` Arjan van de Ven
2006-05-02 11:39 ` Jan Engelhardt
[not found] ` <20060502114853.GA9983@mail.ustc.edu.cn>
2006-05-02 11:48 ` Wu Fengguang
2006-05-02 22:03 ` Dave Jones
2006-05-02 8:09 ` Jens Axboe
[not found] ` <20060502082009.GA9038@mail.ustc.edu.cn>
2006-05-02 8:20 ` Wu Fengguang
2006-05-03 22:05 ` Benjamin LaHaise
2006-05-02 19:10 ` Pavel Machek
2006-05-02 23:36 ` Nigel Cunningham
[not found] ` <20060503023505.GB5915@mail.ustc.edu.cn>
2006-05-03 2:35 ` Wu Fengguang
[not found] ` <20060503023223.GA5915@mail.ustc.edu.cn>
2006-05-03 2:32 ` Wu Fengguang
[not found] ` <20060503071948.GD4781@mail.ustc.edu.cn>
2006-05-03 7:19 ` Wu Fengguang
[not found] ` <20060504122830.GA6205@mail.ustc.edu.cn>
2006-05-04 12:28 ` Wu Fengguang
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=200605040908.10727.philipp.marek@bmlv.gv.at \
--to=philipp.marek@bmlv.gv.at \
--cc=akpm@osdl.org \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=lkml@tlinx.org \
--cc=nickpiggin@yahoo.com.au \
--cc=pbadari@us.ibm.com \
--cc=torvalds@osdl.org \
--cc=wfg@mail.ustc.edu.cn \
/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
Powered by JetHome