]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
netfilter: ipv6: nf_defrag: reduce struct net memory waste
authorEric Dumazet <edumazet@google.com>
Wed, 13 Jun 2018 17:11:56 +0000 (10:11 -0700)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:42:31 +0000 (19:42 -0600)
commit581e73c08df24a58870153e036b9d1bdfe45c8a0
tree17ff4b10a04f0250859e377e6f4a6343dbd965bf
parentd081be0258f52f5575170882c1bfe560b9e74dee
netfilter: ipv6: nf_defrag: reduce struct net memory waste

BugLink: https://bugs.launchpad.net/bugs/1835845
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
include/net/net_namespace.h
include/net/netns/ipv6.h
net/ipv6/netfilter/nf_conntrack_reasm.c