[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Aug 9 05:22:23 UTC 2017


            Bug ID: 221356
           Summary: [patch] Improve swapon_check_swzone() function in
           Product: Base System
           Version: 11.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: ota at j.email.ne.jp
          Keywords: patch

Created attachment 185184
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=185184&action=edit
Improve swapon_check_swzone() function

Improve swapon_check_swzone() function.

Change to more descriptive swapon_check_swzone() warnings.
#1 Indicate half the size is recommended size.
(I couldn't figure out and don't know why half is recommended, though.)
#2 Advice when the swap device size exceeds the max size.

Convert swap_pager_full to static variable as it is not used in global space.
Add a unit to swap_total description.
Call uma_zone_get_max() to find proper swap_maxpages.
Use swap_maxpages and other global variable in swapon_check_swzone().
Convert swapon_check_swzone() to a void function.

Patch tested on 11.1-RELEASE and compiled on CURRENT of i386.

How to test
$ swapon <extra devices>
until you exceed these 2 thresholds - half size and the max size.
Easier to test on systems with less memory.

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

More information about the freebsd-bugs mailing list