Skip to content

Commit

Permalink
inet: frags: reorganize struct netns_frags
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Apr 1, 2018
1 parent e5d672a commit c2615cf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/net/inet_frag.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
#include <linux/rhashtable.h>

struct netns_frags {
struct rhashtable rhashtable ____cacheline_aligned_in_smp;

/* Keep atomic mem on separate cachelines in structs that include it */
atomic_long_t mem ____cacheline_aligned_in_smp;
/* sysctls */
long high_thresh;
long low_thresh;
int timeout;
int max_dist;
struct inet_frags *f;

struct rhashtable rhashtable ____cacheline_aligned_in_smp;

/* Keep atomic mem on separate cachelines in structs that include it */
atomic_long_t mem ____cacheline_aligned_in_smp;
};

/**
Expand Down

0 comments on commit c2615cf

Please sign in to comment.