tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mlock() issues

On Wed, Oct 20, 2010 at 11:17:17PM +0100, Sad Clouds wrote:
> On Thu, 21 Oct 2010 00:02:53 +0200
> Michael van Elst <> wrote:
> > The UVM limit is global to all processes, obviously there should
> > be such a limit to keep the system provided with unlocked pages.
> > 
> > You could probably make this configurable, but so far nobody had
> > the need to lock a large part of memory and to adjust that limit.
> Well I accept that you need some unlocked pages to keep things running,
> however hardcoding the limit to 1/3 is a bit extreme. I thought this
> was the whole point of sysctl/rlimit settings, i.e. I'm running as
> root, I know what I'm doing, if I want to lock 95% of physical memory,
> then let me do it.
> Anyway, thanks for demystifying the issue.

As always the rlimit values are fubar....
For a normal user the 'hard' limit should (well to match current
expectations) be set to physmem/3 with the 'soft' limit probably
set to a relatively small value so that mistakes are detected soon.

A non-root user can then increase its own limit to 1/3 physmem, and
root can change its own 'hard' and 'soft' limits to any value it

Even for the simple case of fds, the default 'hard' limit is far too
big (matches an internal kernal limit).


David Laight:

Home | Main Index | Thread Index | Old Index