Re: vm_page_max_wired and gpg...

From: Michael Edenfield <kutulu_at_kutulu.org>
Date: Wed, 14 May 2003 15:39:58 -0400
* peter.edwards_at_openet-telecom.com <peter.edwards_at_openet-telecom.com> [030514 15:23]:

> >For some time now, gpg has been having issues on my -CURRENT system 
> >with being unable to mlock() the ~8k buffer it uses to hold the 
> >decrypted secret key.  A ktrace shows that it's being returned an 
> >EAGAIN from mlock(), which my peeking around has shown could be:
> >
> >1) I hit the RLIMIT_MLOCK limit on memory locking, or
> >2) I hit the system-wide "wired pages" limit.

> The kernel has a "max wired pages" limit, that's set when the swapper
> starts up to be one third of physical memory. You can see this in
> src/sys/vm_pageout.c, on about line 1414:
> 
> > if (vm_page_max_wired == 0)
> > 	vm_page_max_wired = cnt.v_free_count / 3;
> 
> This is pretty much a third of what you see at boot time (and in
> /var/log/messages or dmesg) for "avail memory = "

Duh, I looked right at this code and somehow it didn't hit me.  It 
makes sense, I've got roughly 22M out of 64M wired at any given time, 
which is right at the 1/3 limit.  Now it's just a matter of finding 
out what else I'm running that's locking down pages and stop it.

--Mike


Received on Wed May 14 2003 - 10:39:39 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:08 UTC