[Bug 227436] increasing kern.maxswzone does nothing

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Apr 11 01:43:42 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227436

            Bug ID: 227436
           Summary: increasing kern.maxswzone does nothing
           Product: Base System
           Version: 11.1-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs at FreeBSD.org
          Reporter: curtis at ipv6.occnc.com

Created attachment 192425
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=192425&action=edit
patch to sys/vm/swap_pager.c (see comments for description)

On current and on 11.1 when using a large amount of swap, increasing
kern.maxswzone does not allow more swap to be used as it used to in 11.0.

A patch is attached which has been tested on AMD64 and ARM64 kernels using 11.1
stable and current.  It does the following:

1.  If maxswzone is set to less than the system guess (based on RAM), then
reduce maxswzone as specified (current behaviour).

2.  There is a conditional that could be removed that caps the increase in
maxswzone to 8 times the guess based on RAM (lots of swap, but lots is needed
for small ARM stuff that has 512MB or 1GB RAM.  Also had to increase
kern.maxswzone on some of my AMD64 servers with 8GB RAM).

3.  An increase is made to the effective maxswzone value used (n in the code)
subject to the above conditional (which could be removed).

4.  Change a printf statement to give swap sizes in pages and MB when
kern.maxswzone is too small for the amount of swap.

5.  Add printf indicating the minimum value of kern.maxswzone that will quiet
the warning (and presumably allow that amount of swap to be used).

6.  Add a conditional that catches the case where the guess at the size of
struct swblk in sys/i386/include/param.h is wrong.  This code was removed in
other architectures so affects i386 only.  I added this code temporarily to
amd64 to test.

I've been using this patch with no adverse affect on multiple production
servers and vm for a few weeks.  Given that all it does is allow increase in
kern.maxswzone to take effect, it should be safe and should go into 11.2, but
at least go into 12.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list