summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_pool.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2014-09-26 05:43:14 +0000
committerdlg <dlg@openbsd.org>2014-09-26 05:43:14 +0000
commit5094a3733a9f5385cafc4652c2304a9369540f79 (patch)
treeb52bf71a2f97cebb52d5f0b5019713fdf2b991f2 /sys/kern/subr_pool.c
parentBring back rev 1.249. Now that mp_setperf() has been fixed, it should be (diff)
downloadwireguard-openbsd-5094a3733a9f5385cafc4652c2304a9369540f79.tar.xz
wireguard-openbsd-5094a3733a9f5385cafc4652c2304a9369540f79.zip
fix the calculation of the number of items to prime the pool with
in pool_setlowat. this was stopping arm things from getting spare items into their pmap entry pools, so things that really needed them in a delicate part of boot were failing. reported by rapha@ co-debugging with miod@
Diffstat (limited to 'sys/kern/subr_pool.c')
-rw-r--r--sys/kern/subr_pool.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index 4da74dbb56d..2f8c1366fcc 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.159 2014/09/23 19:54:47 miod Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.160 2014/09/26 05:43:14 dlg Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -855,7 +855,8 @@ pool_setlowat(struct pool *pp, int n)
? 0
: roundup(n, pp->pr_itemsperpage) / pp->pr_itemsperpage;
- prime = pp->pr_nitems - n;
+ if (pp->pr_nitems < n)
+ prime = n - pp->pr_nitems;
mtx_leave(&pp->pr_mtx);
if (prime > 0)