From: Gerard Roudier <groudier@club-internet.fr>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: Rik van Riel <H.H.vanRiel@phys.uu.nl>,
Linux MM <linux-mm@kvack.org>,
Linux Kernel <linux-kernel@vger.rutgers.edu>
Subject: Re: [PATCH] swapin readahead and fixes
Date: Sat, 5 Dec 1998 10:46:40 +0100 (MET) [thread overview]
Message-ID: <Pine.LNX.3.95.981205102900.449A-100000@localhost> (raw)
In-Reply-To: <199812041434.OAA04457@dax.scot.redhat.com>
On Fri, 4 Dec 1998, Stephen C. Tweedie wrote:
> Hi,
>
> On Fri, 4 Dec 1998 15:02:56 +0100 (CET), Rik van Riel
> <H.H.vanRiel@phys.uu.nl> said:
>
> >> One odd thing about the readahead: you don't start the readahead until
> >> _after_ you have synchronously read in the first swap page of the
> >> cluster. Surely it is better to do the readahead first, so that you
> >> are submitting one IO to disk, not two?
>
> > This would severely suck when something else would be doing
> > a run_taskqueue(&tq_disk). It would mean that we'd read
> > n+1..n+15 before n itself.
>
> No, not at all. This is already the way we do all readahead
> everywhere in the kernel.
>
> The idea is to do readahead for all the data you want, *including* the
> bit you are going to need right away. Once that is done, you just
> wait for the IO to complete on that first item.
Indeed.
In the old time, swapping and paging were different things, but they seems
to be confused in Linux.
You may perform read-ahead when you really swap in a process that had been
swapped out. But about paging, you must consider that this mechanism is
not sequential but mostly ramdom in RL. So you just want to read more data
at the same time and near the location that faulted. Reading-ahead is
obviously candidate for this optimization, but reading behind must also be
considered in my opinion.
File read-ahead is based on the way that data file are often accessed
sequentially by applications and we have to detect this behaviour prior
to reading ahead large data blocks.
For mmapped file, you may want to allow applications to tell you as
they intend to access data and trust them. But for paging, you just
want to read more data than 1 single page at a time, assuming that
data near the faulted address have good chances to be accessed by
the application soon.
That's my current opinion on this topic.
Regards,
Gerard.
--
This is a majordomo managed list. To unsubscribe, send a message with
the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org
next prev parent reply other threads:[~1998-12-05 9:35 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-12-03 17:56 Rik van Riel
1998-12-04 11:34 ` Stephen C. Tweedie
1998-12-04 14:02 ` Rik van Riel
1998-12-04 14:34 ` Stephen C. Tweedie
1998-12-05 9:46 ` Gerard Roudier [this message]
1998-12-07 16:50 ` Stephen C. Tweedie
1998-12-08 1:34 ` Billy Harvey
1998-12-08 2:31 ` Rik van Riel
1998-12-08 2:51 ` Billy Harvey
1998-12-08 3:00 ` Rik van Riel
1998-12-08 12:35 ` Stephen C. Tweedie
1998-12-08 13:51 ` Rik van Riel
1998-12-09 2:41 ` Drago Goricanec
1998-12-09 11:58 ` Stephen C. Tweedie
1998-12-08 12:21 ` Stephen C. Tweedie
1998-12-05 10:47 ` Gerard Roudier
1998-12-04 19:25 ` Chris Evans
1998-12-04 20:47 ` Rik van Riel
1998-12-05 18:59 ` Alan Cox
1998-12-05 19:02 ` Rik van Riel
1998-12-06 5:20 ` Rik van Riel
1998-12-06 5:23 ` Steve VanDevender
1998-12-07 11:52 ` 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.95.981205102900.449A-100000@localhost \
--to=groudier@club-internet.fr \
--cc=H.H.vanRiel@phys.uu.nl \
--cc=linux-kernel@vger.rutgers.edu \
--cc=linux-mm@kvack.org \
--cc=sct@redhat.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