[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1424443737.5565.12.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Fri, 20 Feb 2015 06:48:57 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: netdev <netdev@...r.kernel.org>, Thomas Graf <tgraf@...g.ch>
Subject: [PATCH net] rhashtable: ensure cache line alignment on bucket_table
From: Eric Dumazet <edumazet@...gle.com>
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@...gle.com>
---
include/linux/rhashtable.h | 9 +++++----
1 file 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 {
* @buckets: size * hash buckets
*/
struct bucket_table {
- size_t size;
- unsigned int locks_mask;
- spinlock_t *locks;
- struct rhash_head __rcu *buckets[];
+ size_t size;
+ unsigned int locks_mask;
+ spinlock_t *locks;
+
+ struct rhash_head __rcu *buckets[] ____cacheline_aligned_in_smp;
};
typedef u32 (*rht_hashfn_t)(const void *data, u32 len, u32 seed);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists