Skip to content

Commit

Permalink
rhashtable: ensure cache line alignment on bucket_table
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and davem330 committed Feb 22, 2015
1 parent a4176a9 commit b9ebafb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/linux/rhashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b9ebafb

Please sign in to comment.