aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Benc <jbenc@redhat.com>2016-04-22 06:40:02 -0400
committerDavid S. Miller <davem@davemloft.net>2016-04-25 16:20:09 -0400
commit0868e2538e45a9ed68e2b14adc42b020a36aae1d (patch)
tree3e70f4b4a21790c38acc1af27e210c66f4a449a0
parent6a025a50b523478b7c8112643cc94f5fd3d312ce (diff)
route: move lwtunnel state to a single place
Commit 751a587ac9f9 ("route: fix breakage after moving lwtunnel state") moved lwtstate to the end of dst_entry for 32bit archs. This makes it share the cacheline with __refcnt which had an unkown effect on performance. For this reason, the pointer was kept in place for 64bit archs. However, later performance measurements showed this is of no concern. It turns out that every performance sensitive path that accesses lwtstate accesses also struct rtable or struct rt6_info which share the same cache line. Thus, to get rid of a few #ifdefs, move the field to the end of the struct also for 64bit. Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/dst.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 5c98443c1c9e..6835d224d47b 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -85,12 +85,11 @@ struct dst_entry {
85#endif 85#endif
86 86
87#ifdef CONFIG_64BIT 87#ifdef CONFIG_64BIT
88 struct lwtunnel_state *lwtstate;
89 /* 88 /*
90 * Align __refcnt to a 64 bytes alignment 89 * Align __refcnt to a 64 bytes alignment
91 * (L1_CACHE_SIZE would be too much) 90 * (L1_CACHE_SIZE would be too much)
92 */ 91 */
93 long __pad_to_align_refcnt[1]; 92 long __pad_to_align_refcnt[2];
94#endif 93#endif
95 /* 94 /*
96 * __refcnt wants to be on a different cache line from 95 * __refcnt wants to be on a different cache line from
@@ -99,9 +98,7 @@ struct dst_entry {
99 atomic_t __refcnt; /* client references */ 98 atomic_t __refcnt; /* client references */
100 int __use; 99 int __use;
101 unsigned long lastuse; 100 unsigned long lastuse;
102#ifndef CONFIG_64BIT
103 struct lwtunnel_state *lwtstate; 101 struct lwtunnel_state *lwtstate;
104#endif
105 union { 102 union {
106 struct dst_entry *next; 103 struct dst_entry *next;
107 struct rtable __rcu *rt_next; 104 struct rtable __rcu *rt_next;