Subject: Re: lazy mlock?
To: Wojciech Puchar <wojtek@chylonia.3miasto.net>
From: Allen Briggs <briggs@wasabisystems.com>
List: tech-kern
Date: 04/18/2002 09:13:14
On Thu, Apr 18, 2002 at 08:59:44AM +0200, Wojciech Puchar wrote:
> ulimit can limit locked memory.

True, but that doesn't help solve the problem.  If I'm writing an
application with the approximate size, configurability, and complexity
of ntp, I don't necessarily know which parts of the application
will be in use, how much stack space will be used, etc.  If I don't
want the necessary parts to be paged out, but I don't know what my
working set is, I am forced to attempt to mlock() more than I
strictly need because I don't *know* what I necessarily need.
ulimit can limit the amount of locked memory, sure, but that doesn't
help optimize the amount that will be locked--it may simply prevent
the application from running.

I think the lazy mlock() is an excellent way for the kernel and
application to work together in a way that minimizes overall program
(application + kernel) complexity while maximizing efficiency.
This makes sense to me and seems to be a natural extension of a
demand-paged virtual memory system as a whole.

-allen

-- 
 Allen Briggs                     briggs@wasabisystems.com
 http://www.wasabisystems.com/    Quality NetBSD CDs, Sales, Support, Service
NetBSD development for Alpha, ARM, M68K, MIPS, PowerPC, SuperH, XScale, etc...