summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2017-09-06 07:06:58 +0000
committerLuiz Souza <luiz@netgate.com>2018-02-21 15:17:27 -0300
commit62bbacd241ac55321158bc2e1eb38d4bd46be6c6 (patch)
tree2c25c29cbad1acdca1f8a840cd56ba734d33096a
parent92cc32ed7273a72e2f03bab61921597cb35bffd1 (diff)
downloadFreeBSD-src-62bbacd241ac55321158bc2e1eb38d4bd46be6c6.zip
FreeBSD-src-62bbacd241ac55321158bc2e1eb38d4bd46be6c6.tar.gz
MFC r323018:
Adjust interface of swapon_check_swzone() to its actual usage. PR: 221356 (cherry picked from commit 2481224bb101ec60b11dc294c29ba3fbbc176659)
-rw-r--r--sys/vm/swap_pager.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 7378b6d..8bc0d20 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -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 nblks,
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);
}
OpenPOWER on IntegriCloud