All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] rhashtable: ensure cache line alignment on bucket_table
@ 2015-02-20 14:48 Eric Dumazet
  2015-02-20 14:53 ` Daniel Borkmann
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Dumazet @ 2015-02-20 14:48 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Thomas Graf

From: Eric Dumazet <edumazet@google.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@google.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);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] rhashtable: ensure cache line alignment on bucket_table
  2015-02-20 14:48 [PATCH net] rhashtable: ensure cache line alignment on bucket_table Eric Dumazet
@ 2015-02-20 14:53 ` Daniel Borkmann
  2015-02-20 23:39 ` Thomas Graf
  2015-02-22  3:00 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Borkmann @ 2015-02-20 14:53 UTC (permalink / raw)
  To: Eric Dumazet, David Miller; +Cc: netdev, Thomas Graf

On 02/20/2015 03:48 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.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@google.com>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] rhashtable: ensure cache line alignment on bucket_table
  2015-02-20 14:48 [PATCH net] rhashtable: ensure cache line alignment on bucket_table Eric Dumazet
  2015-02-20 14:53 ` Daniel Borkmann
@ 2015-02-20 23:39 ` Thomas Graf
  2015-02-22  3:00 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Graf @ 2015-02-20 23:39 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev

On 02/20/15 at 06:48am, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.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@google.com>

Acked-by: Thomas Graf <tgraf@suug.ch>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] rhashtable: ensure cache line alignment on bucket_table
  2015-02-20 14:48 [PATCH net] rhashtable: ensure cache line alignment on bucket_table Eric Dumazet
  2015-02-20 14:53 ` Daniel Borkmann
  2015-02-20 23:39 ` Thomas Graf
@ 2015-02-22  3:00 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-02-22  3:00 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, tgraf

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 20 Feb 2015 06:48:57 -0800

> From: Eric Dumazet <edumazet@google.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@google.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-22  3:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-20 14:48 [PATCH net] rhashtable: ensure cache line alignment on bucket_table Eric Dumazet
2015-02-20 14:53 ` Daniel Borkmann
2015-02-20 23:39 ` Thomas Graf
2015-02-22  3:00 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.