Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 May 1996 17:54:01 -0500 (CDT)
From:      Joe Greco <jgreco@brasil.moneng.mei.com>
To:        hackers@freebsd.org
Cc:        dyson@freebsd.org
Subject:   A question for the VM gurus..!
Message-ID:  <199605142254.RAA11225@brasil.moneng.mei.com>

next in thread | raw e-mail | index | archive | help
Summary:  curious about the status of madvise/mincore.

A quick find /usr/src/sys -type f -print | xargs grep MADV reveals that 
the MADV constants aren't used anywhere in the kernel (at least on my
2.1R systems).

I see madvise and mincore return EOPNOTSUPP.

Do we have any plans to support this, for those of us who would prefer to
keep our VM systems more informed?

For example, under certain conditions, I would like to map a very large
file, and access portions in a random (but not necessarily in sequence)
fashion.  Without faulting, because I have a monolithic server process, that
_could_ be servicing somebody else right now, even if I can't access _this_
bit of data yet.  :-)  I can do this if I can use madvise() to tell the
system, MADV_WILLNEED, and then poll with mincore() every so often to see if
the page is available yet (and of course I can take the fault hit if I get
tired of waiting too long).

Or, I would like to defeat caching of file data that I _know_ has an
extremely low probability of being hit again within a useful timeframe
(MADV_DONTNEED), in order to help increase the likelihood of very 
_useful_ data still being in the cache.  (think:  "news server").

One answer is to get more RAM and lock everything I really want in memory.
That is echhhhy given the amount of RAM I would have to buy.  It would be
much cooler if I could just drop hints to the VM system like I can on
Slowaris.

I realize that there is no _guarantee_ that any OS has to listen to the
hints, but it has a tendency to make certain programs more efficient,
particularly when dealing with large amounts of data on systems with
moderate resources.

... Joe

-------------------------------------------------------------------------------
Joe Greco - Systems Administrator			      jgreco@ns.sol.net
Solaria Public Access UNIX - Milwaukee, WI			   414/546-7968



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