Date: Wed, 6 Sep 2017 07:06:58 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r323210 - stable/11/sys/vm Message-ID: <201709060706.v8676wCX007195@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Wed Sep 6 07:06:58 2017 New Revision: 323210 URL: https://svnweb.freebsd.org/changeset/base/323210 Log: MFC r323018: Adjust interface of swapon_check_swzone() to its actual usage. PR: 221356 Modified: stable/11/sys/vm/swap_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/swap_pager.c ============================================================================== --- stable/11/sys/vm/swap_pager.c Wed Sep 6 07:04:29 2017 (r323209) +++ stable/11/sys/vm/swap_pager.c Wed Sep 6 07:06:58 2017 (r323210) @@ -2071,13 +2071,14 @@ done: /* * Check that the total amount of swap currently configured does not * exceed half the theoretical maximum. If it does, print a warning - * message and return -1; otherwise, return 0. + * message. */ -static int -swapon_check_swzone(unsigned long npages) +static void +swapon_check_swzone(void) { - unsigned long maxpages; + unsigned long maxpages, npages; + npages = swap_total / PAGE_SIZE; /* absolute maximum we can handle assuming 100% efficiency */ maxpages = uma_zone_get_max(swap_zone) * SWAP_META_PAGES; @@ -2088,9 +2089,7 @@ swapon_check_swzone(unsigned long npages) npages, maxpages / 2); printf("warning: increase kern.maxswzone " "or reduce amount of swap.\n"); - return (-1); } - return (0); } static void @@ -2158,7 +2157,7 @@ swaponsomething(struct vnode *vp, void *id, u_long nbl nswapdev++; swap_pager_avail += nblks - 2; swap_total += (vm_ooffset_t)nblks * PAGE_SIZE; - swapon_check_swzone(swap_total / PAGE_SIZE); + swapon_check_swzone(); swp_sizecheck(); mtx_unlock(&sw_dev_mtx); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709060706.v8676wCX007195>