summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-01-23 00:39:49 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-01-23 00:39:49 +0000
commit428a9d0c41ac6e6a1e3b34fe87ab6ef38f3764cb (patch)
treebca3c796baa50ba1a667d9fc1450766d842763b4 /sys/dev
parentad9498378fb50081ca58cbd745f9705b789f2da8 (diff)
Pool deals fairly well with physical memory shortage, but it doesn't deal
well (not at all) with shortages of the vm_map where the pages are mapped (usually kmem_map). Try to deal with it: - group all information the backend allocator for a pool in a separate struct. The pool will only have a pointer to that struct. - change the pool_init API to reflect that. - link all pools allocating from the same allocator on a linked list. - Since an allocator is responsible to wait for physical memory it will only fail (waitok) when it runs out of its backing vm_map, carefully drain pools using the same allocator so that va space is freed. (see comments in code for caveats and details). - change pool_reclaim to return if it actually succeeded to free some memory, use that information to make draining easier and more efficient. - get rid of PR_URGENT, noone uses it.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/ncr53c9x.c4
-rw-r--r--sys/dev/ic/wdc.c4
-rw-r--r--sys/dev/raidframe/rf_openbsdkintf.c5
3 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c
index 71801c15489..7f468eee780 100644
--- a/sys/dev/ic/ncr53c9x.c
+++ b/sys/dev/ic/ncr53c9x.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ncr53c9x.c,v 1.11 2001/12/17 23:13:41 nordin Exp $ */
+/* $OpenBSD: ncr53c9x.c,v 1.12 2002/01/23 00:39:47 art Exp $ */
/* $NetBSD: ncr53c9x.c,v 1.56 2000/11/30 14:41:46 thorpej Exp $ */
/*
@@ -376,7 +376,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 a26d906990d..3a37dbe17b9 100644
--- a/sys/dev/ic/wdc.c
+++ b/sys/dev/ic/wdc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdc.c,v 1.45 2002/01/12 05:36:09 jason Exp $ */
+/* $OpenBSD: wdc.c,v 1.46 2002/01/23 00:39:47 art Exp $ */
/* $NetBSD: wdc.c,v 1.68 1999/06/23 19:00:17 bouyer Exp $ */
@@ -659,7 +659,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_openbsdkintf.c b/sys/dev/raidframe/rf_openbsdkintf.c
index b1f536952b0..0c6b5861bbc 100644
--- a/sys/dev/raidframe/rf_openbsdkintf.c
+++ b/sys/dev/raidframe/rf_openbsdkintf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rf_openbsdkintf.c,v 1.12 2001/12/29 21:51:18 tdeval Exp $ */
+/* $OpenBSD: rf_openbsdkintf.c,v 1.13 2002/01/23 00:39:47 art Exp $ */
/* $NetBSD: rf_netbsdkintf.c,v 1.109 2001/07/27 03:30:07 oster Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -1641,8 +1641,7 @@ raidinit(raidPtr)
rs = &raid_softc[unit];
pool_init(&rs->sc_cbufpool, sizeof(struct raidbuf), 0,
- 0, 0, "raidpl", 0, NULL, NULL, M_RAIDFRAME);
-
+ 0, 0, "raidpl", NULL);
/* XXX should check return code first... */
rs->sc_flags |= RAIDF_INITED;