]> git.karo-electronics.de Git - linux-beck.git/commit
net: reorder struct netns_ct for better cache-line usage
authorJesper Dangaard Brouer <brouer@redhat.com>
Fri, 15 Nov 2013 14:57:53 +0000 (15:57 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 13 Dec 2013 11:55:55 +0000 (12:55 +0100)
commit8cf4d6a224a0226987d9cba69cb46d93814fe449
tree78944628c08fc8b4f409d80cca43026f8d74c723
parent68536053600425c24aba031c45f053d447eedd9c
net: reorder struct netns_ct for better cache-line usage

Reorder struct netns_ct so that atomic_t "count" changes don't
slowdown users of read mostly fields.

This is based on Eric Dumazet's proposed patch:
 "netfilter: conntrack: remove the central spinlock"
 http://thread.gmane.org/gmane.linux.network/268758/focus=47306

The tricky part of cache-aligning this structure, that it is getting
inlined in struct net (include/net/net_namespace.h), thus changes to
other netns_xxx structures affects our alignment.

Eric's original patch contained an ambiguity on 32-bit regarding
alignment in struct net.  This patch also takes 32-bit into account,
and in case of changed (struct net) alignment sysctl_xxx entries have
been ordered according to how often they are accessed.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Reviewed-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netns/conntrack.h