Commit 789575b2 authored by Rusty Russell's avatar Rusty Russell Committed by David S. Miller

[NETFILTER]: Shuffle conntrack structure for better cacheline behavior

Every time we walk the conntrack hashtable list, we hit the same
cacheline that is dirtied by the use of the conntrack
entry. Shuffling these entries to the end should help this
(sizeof(struct ip_conntrack)) > cacheline size).
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6c7dd95f
......@@ -172,9 +172,6 @@ struct ip_conntrack
plus 1 for any connection(s) we are `master' for */
struct nf_conntrack ct_general;
/* These are my tuples; original and reply */
struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX];
/* Have we seen traffic both ways yet? (bitset) */
unsigned long status;
......@@ -220,6 +217,9 @@ struct ip_conntrack
} nat;
#endif /* CONFIG_IP_NF_NAT_NEEDED */
/* Traversed often, so hopefully in different cacheline to top */
/* These are my tuples; original and reply */
struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX];
};
/* get master conntrack via master expectation */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment