summaryrefslogtreecommitdiff
path: root/sys/net/pfkeyv2.c
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/net/pfkeyv2.c
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/net/pfkeyv2.c')
-rw-r--r--sys/net/pfkeyv2.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c
index 123be415ca4..7dac1fb3b11 100644
--- a/sys/net/pfkeyv2.c
+++ b/sys/net/pfkeyv2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkeyv2.c,v 1.77 2001/08/05 11:03:07 angelos Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.78 2002/01/23 00:39:48 art Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
@@ -1543,8 +1543,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len)
{
ipsec_policy_pool_initialized = 1;
pool_init(&ipsec_policy_pool, sizeof(struct ipsec_policy),
- 0, 0, PR_FREEHEADER, "ipsec policy", 0, NULL,
- NULL, M_IPSEC_POLICY);
+ 0, 0, PR_FREEHEADER, "ipsec policy", NULL);
}
/* Allocate policy entry */