Jörg Schilling wrote:
> Peng Du <imdup...@gmail.com> wrote:
> 
> > Hello, experts
> >
> > I have a question about syscall "madvise"
> (http://docs.sun.com/app/docs/doc/816-5168/madvise-3c?
> a=view). I want to know whether MADV_WILLNEED  and
> MADV_DONTNEED will affect pageout decisions. In my
> intuition, page scanner should try to keep
> MADV_WILLNEED pages in physical memory, and prefer
> MADV_DONTNEED pages for swapping out. 
> 
> I tried to use this 10 years ago in order to make
> star faster to no avail.
> I would like to see a way to tell Solaris to do read
> aheads but to remove 
> anything from the cache after it was read once.

Awhile back, I wrote something (attached) that uses MADV_DONTNEED
to free mappings of entire files (causes them to be abandoned from the
page cache).  Back when memtool (from playground.sun.com) was still maintained,
it was quite visible that it worked, at any rate for shared, read-only mappings.
I'd have to dig through kernel code to guess whether or not it would work for
other sorts of mappings, or what might cause it to appear not to work.  Having
plenty of other things to do at the moment, I'll leave that as an exercise for 
the
reader.

(The program was mostly to allow starting from the same point on tests involving
I/O on  the files whose mappings I would free between tests.)
-- 
This message posted from opensolaris.org

Attachment: freemap.c
Description: Binary data

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to