From: Rik van Riel <H.H.vanRiel@phys.uu.nl>
To: Linux MM <linux-mm@kvack.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: readahead/behind algorithm
Date: Mon, 7 Dec 1998 21:17:56 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.3.96.981207195746.32057A-100000@mirkwood.dummy.home> (raw)
Hi,
I've thought a bit about what the 'ideal' readahead/behind
algorithm would be and reached the following conclusion.
1. we test the presence of pages in the proximity of the
faulting page (31 behind, 32 ahead) building a map of
64 pages.
2. we see how many pages are already present and mapped
in these locations:
- 31-15 pages behind
- 14-01 pages behind
- 01-15 pages ahead
- 16-32 pages ahead
3. if there are a lot of (20? 25?) pages behind and less
than 8 pages ahead (from a previous readahead?) we read
possibly up to the 32-page mark
4. same for read-behind (so a program can walk through it's
address space the other way around at full speed :)
5. if there are only a very few pages present around us (only
using the 'near' indexes) we read 7 behind and 8 ahead
6. if there are quite a lot of pages present in our vincinity,
chances are that we've already had situation 5 so we can
establish a sense of direction and read in 16 pages in that
direction
Of course, we use the physical location of all these pages in
swap and ignore pages that are far away physically and cannot
efficiently be clustered with other I/O requests.
Ideally we'd also keep track of those pages (using 2 lists,
which we alternately zero to forget old requests) and test
the physical vincinity of our swap requests in order to
read in the ones that were too 'remote' previously...
This is not the most clear explanation of what I meant,
but my mind is too foggy now to make a complete explanation :)
cheers,
Rik -- the flu hits, the flu hits, the flu hits -- MORE
+-------------------------------------------------------------------+
| Linux memory management tour guide. H.H.vanRiel@phys.uu.nl |
| Scouting Vries cubscout leader. http://www.phys.uu.nl/~riel/ |
+-------------------------------------------------------------------+
--
This is a majordomo managed list. To unsubscribe, send a message with
the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org
next reply other threads:[~1998-12-07 20:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-12-07 20:17 Rik van Riel [this message]
1998-12-07 22:56 ` Stephen C. Tweedie
1998-12-07 23:12 ` Rik van Riel
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=Pine.LNX.3.96.981207195746.32057A-100000@mirkwood.dummy.home \
--to=h.h.vanriel@phys.uu.nl \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox