diff options
author | Eric Dumazet <edumazet@google.com> | 2018-06-13 10:11:56 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-08-28 07:21:32 +0200 |
commit | 20b50fb6ad8f9bd1c0c9adc7c1fcd9f69e54f7ed (patch) | |
tree | a84429430d3d3f5de43387e285cd81c123773ea4 /include | |
parent | f6d57daec7317c55f04fa19cf58808caf51d3bac (diff) | |
download | linux-stable-20b50fb6ad8f9bd1c0c9adc7c1fcd9f69e54f7ed.tar.gz linux-stable-20b50fb6ad8f9bd1c0c9adc7c1fcd9f69e54f7ed.tar.bz2 linux-stable-20b50fb6ad8f9bd1c0c9adc7c1fcd9f69e54f7ed.zip |
netfilter: ipv6: nf_defrag: reduce struct net memory waste
[ Upstream commit 9ce7bc036ae4cfe3393232c86e9e1fea2153c237 ]
It is a waste of memory to use a full "struct netns_sysctl_ipv6"
while only one pointer is really used, considering netns_sysctl_ipv6
keeps growing.
Also, since "struct netns_frags" has cache line alignment,
it is better to move the frags_hdr pointer outside, otherwise
we spend a full cache line for this pointer.
This saves 192 bytes of memory per netns.
Fixes: c038a767cd69 ("ipv6: add a new namespace for nf_conntrack_reasm")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/net_namespace.h | 1 | ||||
-rw-r--r-- | include/net/netns/ipv6.h | 1 |
2 files changed, 1 insertions, 1 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index ff4081af4d9c..7c9518bf0453 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h @@ -112,6 +112,7 @@ struct net { #endif #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) struct netns_nf_frag nf_frag; + struct ctl_table_header *nf_frag_frags_hdr; #endif struct sock *nfnl; struct sock *nfnl_stash; diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index 69ae41f2098c..c57d055f76bc 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h @@ -81,7 +81,6 @@ struct netns_ipv6 { #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) struct netns_nf_frag { - struct netns_sysctl_ipv6 sysctl; struct netns_frags frags; }; #endif |