From: Daniel Phillips <phillips@bonn-fries.net>
To: Linus Torvalds <torvalds@transmeta.com>,
Patrick Dreker <patrick@dreker.de>
Cc: <phillips@bonn-fries.net>, <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] Optimization for use-once pages
Date: Wed, 25 Jul 2001 03:25:37 +0200 [thread overview]
Message-ID: <0107250325370C.00520@starship> (raw)
In-Reply-To: <Pine.LNX.4.33.0107241328020.29611-100000@penguin.transmeta.com>
In-Reply-To: <Pine.LNX.4.33.0107241328020.29611-100000@penguin.transmeta.com>
On Tuesday 24 July 2001 22:33, Linus Torvalds wrote:
> On Tue, 24 Jul 2001, Patrick Dreker wrote:
> > I just decided to give this patch a try, as I have written a little
> > application which does some statistics over traces dumped by
> > another program by mmap()ing a large file and reading it
> > sequentially. The trace file to be analyzed is about 240 megs in
> > size and consists of records each 249 bytes long. The analysis
> > program opens and the mmap()s the trace file doing some small
> > calculations on the data (basically it adds up fields from the
> > records to get overall values).
>
> Note that the patch won't do much anything for the mmap() case - the
> VM doesn't consider that "use once" anyway, and trying to make it do
> so would be hard, I suspect. It's just very nasty to try to figure
> out whether the user has touched the page a single time or millions
> of times...
>
> We do have the "accessed" bit, but in order to get any access
> patterns we'd have to scan the page tables a _lot_ more than we do
> now. Right now we do it only under memory pressure, and only about
> once per memory cycle, which is not really even remotely enough to
> get anything more than "yes, the user did touch the page"..
>
> In order for mmap() to make a difference with the new code, we could
> do something like look at the adjacent VM pages on page-in. That,
> together with VM hints, might well be able to do similar things for
> mmap. But at a noticeably higher cost than what the current code has.
OK, the truth is, I decided to punt that problem on the assumption I'd
be able to come up with something workable when the time came. Now
having thought about it a little longer I see it's not so easy. It's
time for some free-form thinking.
Maybe there's a relatively simple way. We'll see for either memory
read or write we'll see the fault. At that point the page starts its
death march down the inactive queue and shortly after that the actual
memory operation takes place. Another short time later we clear the
hardware referenced bit by some as-yet-undetermined means. At the
south end of the queue we check the hardware referenced bit and
reactivate or continue with the eviction process as with the current
patch.
Now I sense there are gotchas here that I'm not entirely on top of -
the swap side of the memory manager being a little less than crystal
clear to me at this point. Let me start by guessing that it's not so
easy to know which pte to look in for the referenced bit. However, we
could cheat and store the pte address in the struct page, or perhaps in
the buffers, which happen to be still attached at the time.
Hmm, just a first idea, and admittedly ugly. I think what I really
have to do is some more code study.
--
Daniel
next prev parent reply other threads:[~2001-07-25 1:21 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-24 3:47 [RFC] Optimization for use-once pages Daniel Phillips
2001-07-24 12:38 ` jlnance
2001-07-24 16:56 ` Rik van Riel
2001-07-25 0:04 ` Daniel Phillips
2001-07-25 0:43 ` Anton Altaparmakov
2001-07-25 1:30 ` Daniel Phillips
2001-07-25 21:18 ` Steve Lord
2001-07-24 16:48 ` Linus Torvalds
2001-07-24 17:04 ` Rik van Riel
2001-07-24 18:14 ` Daniel Phillips
2001-07-24 18:15 ` Rik van Riel
2001-07-24 19:41 ` Is /dev/epoll scheduled for official inclusion anytime soon? David E. Weekly
2001-07-24 20:05 ` Rik van Riel
2001-07-24 20:26 ` linux partitioning in IA64 hiufungeric.tse
2001-07-25 9:29 ` Mike A. Harris
2001-07-24 20:24 ` [RFC] Optimization for use-once pages Patrick Dreker
2001-07-24 20:32 ` Rik van Riel
2001-07-24 22:16 ` Patrick Dreker
2001-07-24 22:25 ` Rik van Riel
2001-07-25 0:27 ` Linus Torvalds
2001-07-25 8:20 ` Patrick Dreker
2001-07-25 12:57 ` Martin Devera
2001-07-25 14:16 ` Daniel Phillips
2001-07-24 20:33 ` Linus Torvalds
2001-07-25 1:25 ` Daniel Phillips [this message]
2001-07-25 0:18 ` Daniel Phillips
2001-07-24 20:27 ` Marcelo Tosatti
2001-07-24 22:05 ` Rik van Riel
2001-07-24 20:53 ` Marcelo Tosatti
2001-07-24 22:27 ` Rik van Riel
2001-07-24 23:09 ` Daniel Phillips
2001-07-24 19:35 ` Rob Landley
2001-07-25 6:10 ` Marcelo Tosatti
2001-07-25 8:32 ` Eric W. Biederman
2001-07-25 12:53 ` Daniel Phillips
2001-07-25 16:05 ` Eric W. Biederman
2001-07-25 12:57 ` Daniel Phillips
2001-07-25 5:12 ` Andrew Morton
2001-07-25 6:33 ` Marcelo Tosatti
2001-07-30 18:09 ` Marcelo Tosatti
2001-07-24 22:41 ` Daniel Phillips
2001-07-24 22:22 ` Daniel Phillips
2001-07-25 2:31 ` Marcelo Tosatti
[not found] <010301c11463$1ee00440$294b82ce@connecttech.com>
2001-07-24 17:07 ` Rik van Riel
2001-07-24 17:42 ` Stuart MacDonald
2001-07-24 17:51 ` Rik van Riel
2001-07-24 18:09 ` Stuart MacDonald
2001-07-24 18:15 ` Mike Castle
2001-07-24 18:21 ` Rik van Riel
2001-07-24 17:44 ` Mike Castle
2001-07-24 17:52 ` Rik van Riel
[not found] <0107251802300B.00907@starship>
2001-07-25 16:41 ` Rik van Riel
2001-07-25 17:46 ` Daniel Phillips
2001-07-26 8:36 ` Eric W. Biederman
2001-07-26 12:06 ` Daniel Phillips
2001-07-26 10:38 ` Marcelo Tosatti
2001-07-26 12:17 ` Daniel Phillips
-- strict thread matches above, loose matches on Subject: below --
2001-07-26 3:27 Ed Tomlinson
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=0107250325370C.00520@starship \
--to=phillips@bonn-fries.net \
--cc=linux-kernel@vger.kernel.org \
--cc=patrick@dreker.de \
--cc=torvalds@transmeta.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