[Bug 230619] pf: tables use non SMP-friendly counters
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Wed Aug 15 10:06:31 UTC 2018
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230619
Kristof Provost <kp at freebsd.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kp at freebsd.org
--- Comment #2 from Kristof Provost <kp at freebsd.org> ---
It's a tradeoff. pfr_update_stats() is currently called without any relevant
locks held, so there's a risk of both a memory leak and incorrect counting.
Using PCPU counters (and always allocating them) mitigates this.
One alternative would be to take the rules lock, which is usually used to
protect tables, but we'd have to take it for writing, to ensure no other
threads are updating the counters at the same time, which I would expect to be
devastating for throughput.
We might be able to get away with a per-table (but there are throughput
concerns for that too), or even per pfr_kentry lock, but the locking structure
of pf is already complex, and I'm not immediately clear on how it would
interact with the rest of the locking.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-pf
mailing list