]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: memcg accounting for dynamically allocated objects
authorVasily Averin <vasily.averin@linux.dev>
Sat, 2 Apr 2022 09:50:37 +0000 (12:50 +0300)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 5 Apr 2022 09:55:46 +0000 (11:55 +0200)
commit3683abb2f324871e90a82a91a9593f600f9f7ab6
tree61fcfde10c7b4a8fed378d8685b11f80e27464fa
parent9990d13a7dccf5c23e9b00ed099638ef93433f66
netfilter: nf_tables: memcg accounting for dynamically allocated objects

nft_*.c files whose NFT_EXPR_STATEFUL flag is set on need to
use __GFP_ACCOUNT flag for objects that are dynamically
allocated from the packet path.

Such objects are allocated inside nft_expr_ops->init() callbacks
executed in task context while processing netlink messages.

In addition, this patch adds accounting to nft_set_elem_expr_clone()
used for the same purposes.

Signed-off-by: Vasily Averin <vvs@openvz.org>
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c
net/netfilter/nft_connlimit.c
net/netfilter/nft_counter.c
net/netfilter/nft_last.c
net/netfilter/nft_limit.c
net/netfilter/nft_quota.c