swap zone exhausted, increase kern.maxswzone

John-Mark Gurney gurney_j at resnet.uoregon.edu
Sat May 5 17:18:07 UTC 2007


Marc G. Fournier wrote this message on Sat, May 05, 2007 at 13:42 -0300:
> > On 05/05/07, Marc G. Fournier <freebsd at hub.org> wrote:
> >> # sysctl kern.maxswzone
> >> sysctl: unknown oid 'kern.maxswzone'
> >
> > It is a /boot/loader.conf variable, not in sysctl MIB.
> 
> Hrmmm ... then how do I know what to increase it to, if I don't know what it 
> currently set to? :(  I thought all the /boot/loader.conf variables were 
> viewable read only via sysctl ... ?  kinda like nmbclusters:
> 
> # sysctl -a | grep nmbcl
> kern.ipc.nmbclusters: 25600
> 
> I can't set it via sysctl, it has to be in /boot/loader.conf ... but I can at 
> least view its value ...

Take a peek at sys/kern/subr_param.c:
#ifdef VM_SWZONE_SIZE_MAX
        maxswzone = VM_SWZONE_SIZE_MAX;
#endif
        TUNABLE_INT_FETCH("kern.maxswzone", &maxswzone);

and then:
crijmgmac,ttyp8,~/FreeBSD/HEAD/src/sys,507$find . -type f | xargs grep VM_SWZONE_SIZE_MAX
./amd64/include/param.h:#ifndef VM_SWZONE_SIZE_MAX
./amd64/include/param.h:#define VM_SWZONE_SIZE_MAX      (32 * 1024 * 1024)
./boot/common/loader.8:.Dv VM_SWZONE_SIZE_MAX .
./conf/options:VM_SWZONE_SIZE_MAX       opt_param.h
./i386/include/param.h:#ifndef VM_SWZONE_SIZE_MAX
./i386/include/param.h:#define VM_SWZONE_SIZE_MAX       (32 * 1024 * 1024)
./kern/subr_param.c:#ifdef VM_SWZONE_SIZE_MAX
./kern/subr_param.c:    maxswzone = VM_SWZONE_SIZE_MAX;

So, it appears that loader(8) isn't correct:
                   swap the system can support.  This value is specified in
                   bytes of KVA space and defaults to around 70MBytes.  Care

It appears that when dillion made the change almost 5 years ago, he
didn't update loader(8)...  I'll fix that...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-stable mailing list