swap zone exhausted, increase kern.maxswzone

Matthew Dillon dillon at apollo.backplane.com
Sat May 5 17:46:57 UTC 2007


    Basically maxswzone is the amount of KVM the kernel is willing to
    use to store 'struct swblock' structures.

    These are the little structures that are stuck onto VM objects and
    specify which pages in the VM object(s) correspond to which pages
    of swap, for any swapped out data that no longer has a vm_page_t.

    It should be almost impossible to run out.  Each structure can handle
    16 contiguous swap block assignments in the VM object.  Pages in
    VM objects tend to get swapped out in large linear swaths and the
    dynamic nature of paging tends to enforce this even if things are
    a bit chunky initially.  So running out should just never happen.

    The only thing I can think of is if a machine has a tiny, tiny amount
    of ram and a huge amount of swap.  e.g. like 64M of ram and 2G of swap,
    and actually tries to use it all.  The default KVM reservation is based
    on physical memory, I think.  Otherwise, it just shouldn't happen.

    I see that the code in FreeBSD is using UMA now, I would double check
    that it is actually calculating the proper amount of space allowed to be
    allocated.  Maybe you have a leak somewhere.

    Note that swap interactions have to operate in low-memory situations.
    Make sure UMA isn't gonna have a meltdown if the system is running low
    on freeable VM pages.

						-Matt



More information about the freebsd-stable mailing list