Remove PR_MALLOCOK and PR_STATIC. The former wasn't actually used,

and the latter, while there was some code tested the bit, was woefully
incomplete and also unused by anything.  Besides, PR_STATIC functionality
could be better handled by backend allocators anyhow.

From art@openbsd.org
This commit is contained in:
thorpej 2002-03-09 01:33:33 +00:00
parent e8db553326
commit d54150e78a
2 changed files with 5 additions and 29 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_pool.c,v 1.69 2002/03/08 21:43:54 thorpej Exp $ */
/* $NetBSD: subr_pool.c,v 1.70 2002/03/09 01:33:34 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1999, 2000 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.69 2002/03/08 21:43:54 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.70 2002/03/09 01:33:34 thorpej Exp $");
#include "opt_pool.h"
#include "opt_poollog.h"
@ -580,9 +580,8 @@ pool_destroy(struct pool *pp)
#endif
/* Remove all pages */
if ((pp->pr_roflags & PR_STATIC) == 0)
while ((ph = TAILQ_FIRST(&pp->pr_pagelist)) != NULL)
pr_rmpage(pp, ph, NULL);
while ((ph = TAILQ_FIRST(&pp->pr_pagelist)) != NULL)
pr_rmpage(pp, ph, NULL);
/* Remove from global pool list */
simple_lock(&pool_head_slock);
@ -645,12 +644,6 @@ pool_get(struct pool *pp, int flags)
void *v;
#ifdef DIAGNOSTIC
if (__predict_false((pp->pr_roflags & PR_STATIC) &&
(flags & PR_MALLOCOK))) {
pr_printlog(pp, NULL, printf);
panic("pool_get: static");
}
if (__predict_false(curproc == NULL && doing_shutdown == 0 &&
(flags & PR_WAITOK) != 0))
panic("pool_get: must have NOWAIT");
@ -1178,18 +1171,6 @@ pool_catchup(struct pool *pp)
caddr_t cp;
int error = 0;
if (pp->pr_roflags & PR_STATIC) {
/*
* We dropped below the low water mark, and this is not a
* good thing. Log a warning.
*
* XXX: rate-limit this?
*/
printf("WARNING: static pool `%s' dropped below low water "
"mark\n", pp->pr_wchan);
return (0);
}
while (POOL_NEEDS_CATCHUP(pp)) {
/*
* Call the page back-end allocator for more memory.
@ -1291,9 +1272,6 @@ pool_reclaim(struct pool *pp)
struct pool_pagelist pq;
int s;
if (pp->pr_roflags & PR_STATIC)
return (0);
if (pp->pr_drain_hook != NULL) {
/*
* The drain hook must be called with the pool unlocked.

View File

@ -1,4 +1,4 @@
/* $NetBSD: pool.h,v 1.31 2002/03/08 21:41:59 thorpej Exp $ */
/* $NetBSD: pool.h,v 1.32 2002/03/09 01:33:33 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2000 The NetBSD Foundation, Inc.
@ -128,11 +128,9 @@ struct pool {
const char *pr_wchan; /* tsleep(9) identifier */
unsigned int pr_flags; /* r/w flags */
unsigned int pr_roflags; /* r/o flags */
#define PR_MALLOCOK 0x01
#define PR_NOWAIT 0x00 /* for symmetry */
#define PR_WAITOK 0x02
#define PR_WANTED 0x04
#define PR_STATIC 0x08
#define PR_PHINPAGE 0x40
#define PR_LOGGING 0x80
#define PR_LIMITFAIL 0x100 /* even if waiting, fail if we hit limit */