]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: x_tables: pack percpu counter allocations
authorFlorian Westphal <fw@strlen.de>
Tue, 22 Nov 2016 13:44:19 +0000 (14:44 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 6 Dec 2016 20:42:19 +0000 (21:42 +0100)
commit923b965cf3d0eb620abb886bfb164af6b79499bf
treebdc9adb5d4744f958630b4e56defc818c905dbe3
parentc8845d754b8cac254d95c9126e213e448486cb4a
netfilter: x_tables: pack percpu counter allocations

instead of allocating each xt_counter individually, allocate 4k chunks
and then use these for counter allocation requests.

This should speed up rule evaluation by increasing data locality,
also speeds up ruleset loading because we reduce calls to the percpu
allocator.

As Eric points out we can't use PAGE_SIZE, page_allocator would fail on
arches with 64k page size.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/linux/netfilter/x_tables.h
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/ip_tables.c
net/ipv6/netfilter/ip6_tables.c
net/netfilter/x_tables.c