Skip to content

Commit 8291cd9

Browse files
edumazetgregkh
authored andcommitted
inet: frags: reorganize struct netns_frags
Put the read-mostly fields in a separate cache line at the beginning of struct netns_frags, to reduce false sharing noticed in inet_frag_kill() Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit c2615cf) Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent bd946fb commit 8291cd9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

include/net/inet_frag.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55
#include <linux/rhashtable.h>
66

77
struct netns_frags {
8-
struct rhashtable rhashtable ____cacheline_aligned_in_smp;
9-
10-
/* Keep atomic mem on separate cachelines in structs that include it */
11-
atomic_long_t mem ____cacheline_aligned_in_smp;
128
/* sysctls */
139
long high_thresh;
1410
long low_thresh;
1511
int timeout;
1612
int max_dist;
1713
struct inet_frags *f;
14+
15+
struct rhashtable rhashtable ____cacheline_aligned_in_smp;
16+
17+
/* Keep atomic mem on separate cachelines in structs that include it */
18+
atomic_long_t mem ____cacheline_aligned_in_smp;
1819
};
1920

2021
/**

0 commit comments

Comments
 (0)