Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Oct 1997 20:51:08 +0000
From:      njs3@doc.ic.ac.uk (Niall Smart)
To:        Terry Lambert <tlambert@primenet.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: help with fstat?
Message-ID:  <E0xQf52-0006j9-00@oak67.doc.ic.ac.uk>
In-Reply-To: Terry Lambert <tlambert@primenet.com> "Re: help with fstat?" (Oct 29,  8:04pm)

next in thread | previous in thread | raw e-mail | index | archive | help
On Oct 29,  8:04pm, Terry Lambert wrote:
> If I have a clean page on the LRU already, will the MADV_SEQUENTIAL
> prevent a byte-based traversal of an mmap()'ed file larger than
> memory+swap from discarding my page?
> 
> My desired behaviour is to that the system not force out my clean
> page in favor of the more recently used, but never again to be
> referenced, pages of an MADV_SEQUENTIAL file.
> 
> I want the system to *not* preferentially save newer pages than mine,
> if the newer pages came from an MADV_SEQUENTIAL marked region, and
> my page did not.  I'd consider normal use of the LRU by pages from
> an MADV_SEQUENTIAL marked region to be "cache thrashing", by definition.
> 
> I'd like it to *reuse* pages in that region before going to the LRU
> and endangering the "in core" state of my page.

Does FreeBSD maintain a "free page" list internally that it will
consult before trying the heuristics for replacing a page?  If this
is so then when we page in a page for a memory mapped region with the
MADV_SEQUENTIAL attribute we can immediately add the previous page to the
"free page" list.

If there is no such "free page" list then perhaps it would be prudent
to introduce one or somehow modify the page replacement heuristics to
take into account those pages the we are pretty sure will never be used
again - perhaps they can be folded into the bottom of the LRU list.

As I know absolutely nothing about FreeBSD's memory management internals
and don't have the time or source to check the above comments may be
entirely useless.


Niall



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E0xQf52-0006j9-00>