[lkml]   [2004]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: why swap at all?
On Wednesday 26 May 2004 7:37 am, Matthias Schniedermeyer wrote:

> program to kernel: "i read ONCE though this file caching not useful".

Very true. The system is based on the assumption that just-used pages are
more useful that older pages, and it slows when this isn't true. We need
ways to tell the kernel whether the assumption holds.

(What follows are progressively more impossible ideas that I have no idea how
to implement.)

O_STREAMING and a flag to not cache a file when it closes are a good start.

It would also be useful to do this on a per-process basis. For example, you
could set a running shell so that its (and it's children's) files are
O_STREAMING, and use that shell to launch your one-time greps.

Ulimit could set a limit on how much cache a process and its children could
use. (How much overhead this would this entail?) That would take the place
of the above, and it might also be useful for shell server admins who don't
want one user trashing everyone's interactivity.

Most drastic would be to change the way to choose pages to throw out.
Different processes or pages could have different priorities, so you could
mark interactive processes as keepers even if you haven't used them in days.

It's probably impossible because the kernel only knows about faults, but you
could give frequently but not recently used pages (your day-old browser
window) priority over recently but not frequently used pages (your one-time
grep). You'd also need a way to allow cache to grow, which this would
otherwise curtail.

Tom Felker, <>
<> - Stop fiddling with the volume knob.

Alchemists became chemists when they stopped keeping secrets.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:03    [W:2.471 / U:11.212 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site