diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-01-23 00:39:49 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-01-23 00:39:49 +0000 |
commit | 428a9d0c41ac6e6a1e3b34fe87ab6ef38f3764cb (patch) | |
tree | bca3c796baa50ba1a667d9fc1450766d842763b4 /sys/net/pf.c | |
parent | ad9498378fb50081ca58cbd745f9705b789f2da8 (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/pf.c')
-rw-r--r-- | sys/net/pf.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index 4ad3d368612..88694d58ed3 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.184 2002/01/12 01:34:49 jasoni Exp $ */ +/* $OpenBSD: pf.c,v 1.185 2002/01/23 00:39:48 art Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -959,21 +959,20 @@ pf_print_flags(u_int8_t f) void pfattach(int num) { - /* XXX - no M_* tags, but they are not used anyway */ pool_init(&pf_tree_pl, sizeof(struct pf_tree_node), 0, 0, 0, "pftrpl", - 0, NULL, NULL, 0); + NULL); pool_init(&pf_rule_pl, sizeof(struct pf_rule), 0, 0, 0, "pfrulepl", - 0, NULL, NULL, 0); + NULL); pool_init(&pf_nat_pl, sizeof(struct pf_nat), 0, 0, 0, "pfnatpl", - 0, NULL, NULL, 0); + NULL); pool_init(&pf_binat_pl, sizeof(struct pf_binat), 0, 0, 0, "pfbinatpl", - 0, NULL, NULL, 0); + NULL); pool_init(&pf_rdr_pl, sizeof(struct pf_rdr), 0, 0, 0, "pfrdrpl", - 0, NULL, NULL, 0); + NULL); pool_init(&pf_state_pl, sizeof(struct pf_state), 0, 0, 0, "pfstatepl", - 0, NULL, NULL, 0); + NULL); pool_init(&pf_sport_pl, sizeof(struct pf_port_node), 0, 0, 0, "pfsport", - 0, NULL, NULL, 0); + NULL); TAILQ_INIT(&pf_rules[0]); TAILQ_INIT(&pf_rules[1]); |