diff options
author | Jiri Benc <jbenc@redhat.com> | 2015-08-21 06:41:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-23 19:51:17 -0400 |
commit | 751a587ac9f9a8bf314590fbac32d9e418060c5a (patch) | |
tree | 9ddb90651ebd72777150a6af48f22f7f088b71fb /include/net/dst.h | |
parent | 31fbde9967330404175a06df15bdb24d671d4475 (diff) |
route: fix breakage after moving lwtunnel state
__recnt and related fields need to be in its own cacheline for performance
reasons. Commit 61adedf3e3f1 ("route: move lwtunnel state to dst_entry")
broke that on 32bit archs, causing BUILD_BUG_ON in dst_hold to be triggered.
This patch fixes the breakage by moving the lwtunnel state to the end of
dst_entry on 32bit archs. Unfortunately, this makes it share the cacheline
with __refcnt and may affect performance, thus further patches may be
needed.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Fixes: 61adedf3e3f1 ("route: move lwtunnel state to dst_entry")
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dst.h')
-rw-r--r-- | include/net/dst.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/net/dst.h b/include/net/dst.h index 0a9a723f6c19..ef8f1d43a203 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -44,7 +44,6 @@ struct dst_entry { | |||
44 | #else | 44 | #else |
45 | void *__pad1; | 45 | void *__pad1; |
46 | #endif | 46 | #endif |
47 | struct lwtunnel_state *lwtstate; | ||
48 | int (*input)(struct sk_buff *); | 47 | int (*input)(struct sk_buff *); |
49 | int (*output)(struct sock *sk, struct sk_buff *skb); | 48 | int (*output)(struct sock *sk, struct sk_buff *skb); |
50 | 49 | ||
@@ -85,11 +84,12 @@ struct dst_entry { | |||
85 | __u32 __pad2; | 84 | __u32 __pad2; |
86 | #endif | 85 | #endif |
87 | 86 | ||
87 | #ifdef CONFIG_64BIT | ||
88 | struct lwtunnel_state *lwtstate; | ||
88 | /* | 89 | /* |
89 | * Align __refcnt to a 64 bytes alignment | 90 | * Align __refcnt to a 64 bytes alignment |
90 | * (L1_CACHE_SIZE would be too much) | 91 | * (L1_CACHE_SIZE would be too much) |
91 | */ | 92 | */ |
92 | #ifdef CONFIG_64BIT | ||
93 | long __pad_to_align_refcnt[1]; | 93 | long __pad_to_align_refcnt[1]; |
94 | #endif | 94 | #endif |
95 | /* | 95 | /* |
@@ -99,6 +99,9 @@ struct dst_entry { | |||
99 | atomic_t __refcnt; /* client references */ | 99 | atomic_t __refcnt; /* client references */ |
100 | int __use; | 100 | int __use; |
101 | unsigned long lastuse; | 101 | unsigned long lastuse; |
102 | #ifndef CONFIG_64BIT | ||
103 | struct lwtunnel_state *lwtstate; | ||
104 | #endif | ||
102 | union { | 105 | union { |
103 | struct dst_entry *next; | 106 | struct dst_entry *next; |
104 | struct rtable __rcu *rt_next; | 107 | struct rtable __rcu *rt_next; |