提交 9ba5c404 编写于 作者: B Ben Hutchings 提交者: Pablo Neira Ayuso

netfilter: x_tables: Add note about how to free percpu counters

Due to the way percpu counters are allocated and freed in blocks,
it is not safe to free counters individually.  Currently all callers
do the right thing, but let's note this restriction.

Fixes: ae0ac0ed ("netfilter: x_tables: pack percpu counter allocations")
Signed-off-by: NBen Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 c47d36b3
......@@ -1854,7 +1854,9 @@ EXPORT_SYMBOL_GPL(xt_proto_fini);
* to fetch the real percpu counter.
*
* To speed up allocation and improve data locality, a 4kb block is
* allocated.
* allocated. Freeing any counter may free an entire block, so all
* counters allocated using the same state must be freed at the same
* time.
*
* xt_percpu_counter_alloc_state contains the base address of the
* allocated page and the current sub-offset.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册