If, when a page becomes idle, the backend allocator is waiting for

resources, release the page immediately, rather than letting it sit
around cached.

From art@openbsd.org.
This commit is contained in:
thorpej 2002-03-09 01:37:19 +00:00
parent 951bda42bf
commit 4be86fcc13

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_pool.c,v 1.70 2002/03/09 01:33:34 thorpej Exp $ */ /* $NetBSD: subr_pool.c,v 1.71 2002/03/09 01:37:19 thorpej Exp $ */
/*- /*-
* Copyright (c) 1997, 1999, 2000 The NetBSD Foundation, Inc. * Copyright (c) 1997, 1999, 2000 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.70 2002/03/09 01:33:34 thorpej Exp $"); __KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.71 2002/03/09 01:37:19 thorpej Exp $");
#include "opt_pool.h" #include "opt_pool.h"
#include "opt_poollog.h" #include "opt_poollog.h"
@ -959,7 +959,8 @@ pool_do_put(struct pool *pp, void *v)
*/ */
if (ph->ph_nmissing == 0) { if (ph->ph_nmissing == 0) {
pp->pr_nidle++; pp->pr_nidle++;
if (pp->pr_npages > pp->pr_maxpages) { if (pp->pr_npages > pp->pr_maxpages ||
(pp->pr_alloc->pa_flags & PA_WANT) != 0) {
pr_rmpage(pp, ph, NULL); pr_rmpage(pp, ph, NULL);
} else { } else {
TAILQ_REMOVE(&pp->pr_pagelist, ph, ph_pagelist); TAILQ_REMOVE(&pp->pr_pagelist, ph, ph_pagelist);