inet: frags: reorganize struct netns_frags
authorEric Dumazet <edumazet@google.com>
Sat, 31 Mar 2018 19:58:57 +0000 (12:58 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 1 Apr 2018 03:25:39 +0000 (23:25 -0400)
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>
include/net/inet_frag.h

index a52e727..ed07e37 100644 (file)
@@ -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;
 };
 
 /**