Re: [RFC] Arch option to touch newly allocated pages

From: Andrew Morton (akpm@zip.com.au)
Date: Thu Mar 07 2002 - 17:41:43 EST


Rik van Riel wrote:
>
> On Thu, 7 Mar 2002, Andrew Morton wrote:
>
> > > use-once reduces the VM to FIFO order, which suffers from
> > > belady's anomaly so it doesn't matter much how much memory
> > > you throw at it
> > >
> > > drop-behind will suffer the same problem once the readahead
> > > memory is too large to keep in the system, but at least the
> > > already-used pages won't kick out readahead pages
> >
> > err.. Was there a fix in there somewhere, or are we stuck?
>
> Imagine how TCP backoff would work if it kept old packets
> around and would drop random packets because of too many
> old packets in the buffers.
>
> I suspect that the readahead window resizing might work
> when we throw away the already-used streaming IO pages
> before we start throwing away any pages we're about to
> use.

ewww.. You seem to be implying that when the readahead
code goes to get a new page, it's reclaiming unused
readahead pages *in preference to* already-used pages.

That would be awful, wouldn't it?

Perhaps an algorithm would be:

a) Call mark_page_accessed once against readahead pages.

b) If thrashing is detected, call mark_page_accessed
   twice against readahead pages, to move them onto the
   active list.

   The intent being to say "this page is important. Throw
   something else away".

Seems this would delay the onset of the problem significantly?

-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 07 2002 - 21:01:10 EST