diff options
author | Eric Dumazet <edumazet@google.com> | 2015-02-20 09:48:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-21 21:59:57 -0500 |
commit | b9ebafbe8cfeeddec881504c446cccd0d87a51b6 (patch) | |
tree | bdae10b0c83047a55ed671b4d4d6ca7ebf26a2ab /include/linux/rhashtable.h | |
parent | a4176a9391868bfa87705bcd2e3b49e9b9dd2996 (diff) |
rhashtable: ensure cache line alignment on bucket_table
struct bucket_table contains mostly read fields :
size, locks_mask, locks.
Make sure these are not sharing a cache line with buckets[]
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/rhashtable.h')
-rw-r--r-- | include/linux/rhashtable.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h index 58851275fed9..cb2104be2135 100644 --- a/include/linux/rhashtable.h +++ b/include/linux/rhashtable.h | |||
@@ -54,10 +54,11 @@ struct rhash_head { | |||
54 | * @buckets: size * hash buckets | 54 | * @buckets: size * hash buckets |
55 | */ | 55 | */ |
56 | struct bucket_table { | 56 | struct bucket_table { |
57 | size_t size; | 57 | size_t size; |
58 | unsigned int locks_mask; | 58 | unsigned int locks_mask; |
59 | spinlock_t *locks; | 59 | spinlock_t *locks; |
60 | struct rhash_head __rcu *buckets[]; | 60 | |
61 | struct rhash_head __rcu *buckets[] ____cacheline_aligned_in_smp; | ||
61 | }; | 62 | }; |
62 | 63 | ||
63 | typedef u32 (*rht_hashfn_t)(const void *data, u32 len, u32 seed); | 64 | typedef u32 (*rht_hashfn_t)(const void *data, u32 len, u32 seed); |