> Date: Fri, 4 Sep 2015 13:54:00 +0200 (CEST)
> From: Mark Kettenis <[email protected]>
>
> As far as I can tell, these pools are only ever used from process
> context as well.
>
> ok?
mikeb@ pointed out that pf_rm_rule() may be called from interrupt
context. So here is an updated diff that drops the PR_WAITOK flags
from the pfi_addr_pl and pf_rule_pl pools.
The pools in pf_osfp.c only are always used with PR_WAITOK in
pool_get() and pool_put() is only called from pf_osfp_flush() which is
only ever called from ioctls invoked from userland.
ok?
Index: pf_if.c
===================================================================
RCS file: /cvs/src/sys/net/pf_if.c,v
retrieving revision 1.79
diff -u -p -r1.79 pf_if.c
--- pf_if.c 21 Jul 2015 02:32:04 -0000 1.79
+++ pf_if.c 4 Sep 2015 12:45:19 -0000
@@ -89,7 +89,7 @@ pfi_initialize(void)
return;
pool_init(&pfi_addr_pl, sizeof(struct pfi_dynaddr), 0, 0, 0,
- "pfiaddrpl", &pool_allocator_nointr);
+ "pfiaddrpl", NULL);
pfi_buffer_max = 64;
pfi_buffer = mallocarray(pfi_buffer_max, sizeof(*pfi_buffer),
PFI_MTYPE, M_WAITOK);
Index: pf_ioctl.c
===================================================================
RCS file: /cvs/src/sys/net/pf_ioctl.c,v
retrieving revision 1.289
diff -u -p -r1.289 pf_ioctl.c
--- pf_ioctl.c 21 Jul 2015 02:32:04 -0000 1.289
+++ pf_ioctl.c 4 Sep 2015 12:45:19 -0000
@@ -140,7 +140,7 @@ pfattach(int num)
u_int32_t *timeout = pf_default_rule.timeout;
pool_init(&pf_rule_pl, sizeof(struct pf_rule), 0, 0, 0, "pfrule",
- &pool_allocator_nointr);
+ NULL);
pool_init(&pf_src_tree_pl, sizeof(struct pf_src_node), 0, 0, 0,
"pfsrctr", NULL);
pool_init(&pf_sn_item_pl, sizeof(struct pf_sn_item), 0, 0, 0,
Index: pf_osfp.c
===================================================================
RCS file: /cvs/src/sys/net/pf_osfp.c,v
retrieving revision 1.31
diff -u -p -r1.31 pf_osfp.c
--- pf_osfp.c 18 Jul 2015 19:19:00 -0000 1.31
+++ pf_osfp.c 4 Sep 2015 12:45:19 -0000
@@ -287,10 +287,10 @@ pf_osfp_match(struct pf_osfp_enlist *lis
void
pf_osfp_initialize(void)
{
- pool_init(&pf_osfp_entry_pl, sizeof(struct pf_osfp_entry), 0, 0, 0,
- "pfosfpen", &pool_allocator_nointr);
- pool_init(&pf_osfp_pl, sizeof(struct pf_os_fingerprint), 0, 0, 0,
- "pfosfp", &pool_allocator_nointr);
+ pool_init(&pf_osfp_entry_pl, sizeof(struct pf_osfp_entry), 0, 0,
+ PR_WAITOK, "pfosfpen", NULL);
+ pool_init(&pf_osfp_pl, sizeof(struct pf_os_fingerprint), 0, 0,
+ PR_WAITOK, "pfosfp", NULL);
SLIST_INIT(&pf_osfp_list);
}