Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Oct 1997 17:04:37 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        dyson@FreeBSD.ORG
Cc:        tlambert@primenet.com, angio@angio.net, perlsta@cs.sunyit.edu, hackers@FreeBSD.ORG
Subject:   Re: help with fstat?
Message-ID:  <199710281704.KAA25457@usr06.primenet.com>
In-Reply-To: <199710280422.XAA02123@dyson.iquest.net> from "John S. Dyson" at Oct 27, 97 11:22:50 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > > > There used to be a MAP_SEQUENTIAL flag to get it to discard buffers
> > > > after they had been accesed, instead of forcing more pages off the
> > > > LRU, but BSD doesn't support this.  8-(.
> > > > 
> > > > 
> > > Try madvise(2).  It has a MADV_SEQUENTIAL.
> > 
> > Is this supposed to cause it to discard page A after faulting in page B
> > on the assumption A will not be rereferenced?
> > 
> > I didn't think that it did this in -current...
>
> It doesn't 'discard', but should either deactivate or cache the page.

Then it leaves the machine with quickly faulted pages (no system call
overhead, like read/write would need, so faulting is "unfair") filling
the LRU, pushing off "good" pages in preference for "bad" pages.  In
this case, "good" == "will be referenced again" and "bad" == "will not
be referenced again".


The idea is that the page discard puts the page forward on the LRU.

This is the same thing you would do if the per vnode list was longer
than some quota of in core pages in order to implement per vnode
working set limitations to prevent things like a linker stupid enough
to mmap() your object files from forcing your X server (or other
program) out of core, and murdering interactive response.

I guess it's a little different: taking LRU'ed pages from your own
vnode instead of the global LRU is a page replacement policy change,
and putting discarded pages at the front of the LRU so they are
preferentially reused is a page discard policy change.  But the
net effect in either case is a woking set limitation.

I think the only thing MADV_SEQUENTIAL does is fiddle the slow start
on the read-ahead (unless I'm reading things totally wrong).  You
would still need to take a mapping fault to know what could be
discarded (pages before the page faulted) in the MADV_SEQUENTIAL
case...


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710281704.KAA25457>