diff options
| author | thorpej <thorpej@NetBSD.org> | 2002-03-08 20:48:27 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2002-03-08 20:48:27 +0000 |
| commit | a180cee23b473847ef3a3bebc8e5c778b4bf97cd (patch) | |
| tree | baa8c819b3912e1cee37a1c058dd5c3070f76622 /sys/dev | |
| parent | 16510c2b023cc77a06b739e0808d3be74c428e29 (diff) | |
Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map). Try to deal with this:
* Group all information about the backend allocator for a pool in a
separate structure. The pool references this structure, rather than
the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
to become available, but will still fail if it cannot callocate KVA
space for the pages. If this happens, carefully drain all pools using
the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
some pages, and use that information to make draining easier and more
efficient.
* Get rid of PR_URGENT. There was only one use of it, and it could be
dealt with by the caller.
From art@openbsd.org.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ccd.c | 6 | ||||
| -rw-r--r-- | sys/dev/ic/ncr53c9x.c | 6 | ||||
| -rw-r--r-- | sys/dev/ic/wdc.c | 6 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 6 | ||||
| -rw-r--r-- | sys/dev/rnd.c | 6 | ||||
| -rw-r--r-- | sys/dev/scsipi/scsipi_base.c | 6 | ||||
| -rw-r--r-- | sys/dev/vnd.c | 8 |
7 files changed, 22 insertions, 22 deletions
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c index d2952f3f432..f00a5e0d8de 100644 --- a/sys/dev/ccd.c +++ b/sys/dev/ccd.c @@ -1,4 +1,4 @@ -/* $NetBSD: ccd.c,v 1.75 2002/01/13 19:28:06 tsutsui Exp $ */ +/* $NetBSD: ccd.c,v 1.76 2002/03/08 20:48:37 thorpej Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 1999 The NetBSD Foundation, Inc. @@ -90,7 +90,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.75 2002/01/13 19:28:06 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.76 2002/03/08 20:48:37 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -201,7 +201,7 @@ ccdattach(num) /* Initialize the component buffer pool. */ pool_init(&ccd_cbufpool, sizeof(struct ccdbuf), 0, - 0, 0, "ccdpl", 0, NULL, NULL, M_DEVBUF); + 0, 0, "ccdpl", NULL); /* Initialize per-softc structures. */ for (i = 0; i < num; i++) { diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c index 545ddb7ad5f..b93e3d34c25 100644 --- a/sys/dev/ic/ncr53c9x.c +++ b/sys/dev/ic/ncr53c9x.c @@ -1,4 +1,4 @@ -/* $NetBSD: ncr53c9x.c,v 1.89 2002/01/12 16:03:12 tsutsui Exp $ */ +/* $NetBSD: ncr53c9x.c,v 1.90 2002/03/08 20:48:38 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ncr53c9x.c,v 1.89 2002/01/12 16:03:12 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ncr53c9x.c,v 1.90 2002/03/08 20:48:38 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -429,7 +429,7 @@ ncr53c9x_init(sc, doreset) if (!ecb_pool_initialized) { /* All instances share this pool */ pool_init(&ecb_pool, sizeof(struct ncr53c9x_ecb), 0, 0, 0, - "ncr53c9x_ecb", 0, NULL, NULL, 0); + "ncr53c9x_ecb", NULL); ecb_pool_initialized = 1; } diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c index 678f1a406b9..a63914baeb8 100644 --- a/sys/dev/ic/wdc.c +++ b/sys/dev/ic/wdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: wdc.c,v 1.111 2002/03/04 02:19:10 simonb Exp $ */ +/* $NetBSD: wdc.c,v 1.112 2002/03/08 20:48:38 thorpej Exp $ */ /* @@ -72,7 +72,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.111 2002/03/04 02:19:10 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.112 2002/03/08 20:48:38 thorpej Exp $"); #ifndef WDCDEBUG #define WDCDEBUG @@ -331,7 +331,7 @@ wdcattach(chp) if (inited == 0) { /* Initialize the wdc_xfer pool. */ pool_init(&wdc_xfer_pool, sizeof(struct wdc_xfer), 0, - 0, 0, "wdcspl", 0, NULL, NULL, M_DEVBUF); + 0, 0, "wdcspl", NULL); inited++; } TAILQ_INIT(&chp->ch_queue->sc_xfer); diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 8c4d2cfac1d..ec9deda7af8 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.116 2002/01/09 04:21:43 thorpej Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.117 2002/03/08 20:48:39 thorpej Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -114,7 +114,7 @@ ***********************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.116 2002/01/09 04:21:43 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.117 2002/03/08 20:48:39 thorpej Exp $"); #include <sys/param.h> #include <sys/errno.h> @@ -329,7 +329,7 @@ raidattach(num) /* Initialize the component buffer pool. */ pool_init(&raidframe_cbufpool, sizeof(struct raidbuf), 0, - 0, 0, "raidpl", 0, NULL, NULL, M_RAIDFRAME); + 0, 0, "raidpl", NULL); rc = rf_mutex_init(&rf_sparet_wait_mutex); if (rc) { diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c index 3fadb239ae5..ebe6cd674cd 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $NetBSD: rnd.c,v 1.25 2001/11/13 05:32:50 lukem Exp $ */ +/* $NetBSD: rnd.c,v 1.26 2002/03/08 20:48:37 thorpej Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.25 2001/11/13 05:32:50 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.26 2002/03/08 20:48:37 thorpej Exp $"); #include <sys/param.h> #include <sys/ioctl.h> @@ -288,7 +288,7 @@ rnd_init(void) SIMPLEQ_INIT(&rnd_samples); pool_init(&rnd_mempool, sizeof(rnd_sample_t), 0, 0, 0, "rndsample", - 0, NULL, NULL, 0); + NULL); rndpool_init(&rnd_pool); diff --git a/sys/dev/scsipi/scsipi_base.c b/sys/dev/scsipi/scsipi_base.c index b9761a9ba3d..ea68c2dc07a 100644 --- a/sys/dev/scsipi/scsipi_base.c +++ b/sys/dev/scsipi/scsipi_base.c @@ -1,4 +1,4 @@ -/* $NetBSD: scsipi_base.c,v 1.67 2002/02/21 05:30:30 enami Exp $ */ +/* $NetBSD: scsipi_base.c,v 1.68 2002/03/08 20:48:39 thorpej Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.67 2002/02/21 05:30:30 enami Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.68 2002/03/08 20:48:39 thorpej Exp $"); #include "opt_scsi.h" @@ -101,7 +101,7 @@ scsipi_init() /* Initialize the scsipi_xfer pool. */ pool_init(&scsipi_xfer_pool, sizeof(struct scsipi_xfer), 0, - 0, 0, "scxspl", 0, NULL, NULL, M_DEVBUF); + 0, 0, "scxspl", NULL); } /* diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c index 06e29cec9cb..91048a09fb1 100644 --- a/sys/dev/vnd.c +++ b/sys/dev/vnd.c @@ -1,4 +1,4 @@ -/* $NetBSD: vnd.c,v 1.77 2002/01/13 19:28:08 tsutsui Exp $ */ +/* $NetBSD: vnd.c,v 1.78 2002/03/08 20:48:37 thorpej Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -98,7 +98,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.77 2002/01/13 19:28:08 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.78 2002/03/08 20:48:37 thorpej Exp $"); #if defined(_KERNEL_OPT) #include "fs_nfs.h" @@ -868,9 +868,9 @@ vndioctl(dev, cmd, data, flag, p) /* Initialize the xfer and buffer pools. */ pool_init(&vnd->sc_vxpool, sizeof(struct vndxfer), 0, - 0, 0, "vndxpl", 0, NULL, NULL, M_DEVBUF); + 0, 0, "vndxpl", NULL); pool_init(&vnd->sc_vbpool, sizeof(struct vndbuf), 0, - 0, 0, "vndbpl", 0, NULL, NULL, M_DEVBUF); + 0, 0, "vndbpl", NULL); /* Try and read the disklabel. */ vndgetdisklabel(dev); |
