summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_pool.c
diff options
context:
space:
mode:
authorart <art@openbsd.org>2002-02-23 00:05:14 +0000
committerart <art@openbsd.org>2002-02-23 00:05:14 +0000
commit4eed8d9d0eaab829ad55127990f0aa76ed79fcf4 (patch)
tree3f92222a4a17babb459556d16442cfe989ed29fc /sys/kern/subr_pool.c
parentPools that are only used in the ioctls can use the nointr allocator. (diff)
downloadwireguard-openbsd-4eed8d9d0eaab829ad55127990f0aa76ed79fcf4.tar.xz
wireguard-openbsd-4eed8d9d0eaab829ad55127990f0aa76ed79fcf4.zip
If the allocator has the PA_WANT flag set, return whole pages immediately.
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 c796341e6ed..701332a3837 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.25 2002/02/23 00:03:14 art Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.26 2002/02/23 00:05:14 art Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -942,7 +942,8 @@ pool_do_put(struct pool *pp, void *v)
*/
if (ph->ph_nmissing == 0) {
pp->pr_nidle++;
- if (pp->pr_npages > pp->pr_maxpages) {
+ if (pp->pr_npages > pp->pr_maxpages ||
+ (pp->pr_alloc->pa_flags & PA_WANT)) {
pr_rmpage(pp, ph, NULL);
} else {
TAILQ_REMOVE(&pp->pr_pagelist, ph, ph_pagelist);