diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2018-06-08 21:40:03 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2018-06-08 21:40:03 +0000 |
commit | 4e180881ae4a325cfaeef336aa1a16b0d5bbae67 (patch) | |
tree | c5a4fb99800ba3d30a7f2b689c21dc1e6ff74ceb /sys/netpfil/ipfw/ip_fw_sockopt.c | |
parent | 4f63fbc955b7de6332b3c5507f57389dbd6e75f8 (diff) | |
download | src-4e180881ae4a325cfaeef336aa1a16b0d5bbae67.tar.gz src-4e180881ae4a325cfaeef336aa1a16b0d5bbae67.zip |
uma: implement provisional api for per-cpu zones
Per-cpu zone allocations are very rarely done compared to regular zones.
The intent is to avoid pessimizing the latter case with per-cpu specific
code.
In particular contrary to the claim in r334824, M_ZERO is sometimes being
used for such zones. But the zeroing method is completely different and
braching on it in the fast path for regular zones is a waste of time.
Notes
Notes:
svn path=/head/; revision=334858
Diffstat (limited to 'sys/netpfil/ipfw/ip_fw_sockopt.c')
-rw-r--r-- | sys/netpfil/ipfw/ip_fw_sockopt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c b/sys/netpfil/ipfw/ip_fw_sockopt.c index cda7fab45de9..5d32b2eb0fcd 100644 --- a/sys/netpfil/ipfw/ip_fw_sockopt.c +++ b/sys/netpfil/ipfw/ip_fw_sockopt.c @@ -208,7 +208,7 @@ ipfw_alloc_rule(struct ip_fw_chain *chain, size_t rulesize) struct ip_fw *rule; rule = malloc(rulesize, M_IPFW, M_WAITOK | M_ZERO); - rule->cntr = uma_zalloc(V_ipfw_cntr_zone, M_WAITOK | M_ZERO); + rule->cntr = uma_zalloc_pcpu(V_ipfw_cntr_zone, M_WAITOK | M_ZERO); return (rule); } @@ -217,7 +217,7 @@ static void free_rule(struct ip_fw *rule) { - uma_zfree(V_ipfw_cntr_zone, rule->cntr); + uma_zfree_pcpu(V_ipfw_cntr_zone, rule->cntr); free(rule, M_IPFW); } |