inet: shrink netns_ipv4 by another cache line
authorEric Dumazet <edumazet@google.com>
Wed, 31 Mar 2021 17:52:06 +0000 (10:52 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Mar 2021 21:48:19 +0000 (14:48 -0700)
By shuffling around some fields to remove 8 bytes of hole,
we can save one cache line.

pahole result before/after the patch :

/* size: 768, cachelines: 12, members: 139 */
/* sum members: 673, holes: 11, sum holes: 39 */
/* padding: 56 */
/* paddings: 2, sum paddings: 7 */
/* forced alignments: 1 */

->

/* size: 704, cachelines: 11, members: 139 */
/* sum members: 673, holes: 10, sum holes: 31 */
/* paddings: 2, sum paddings: 7 */
/* forced alignments: 1 */

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/netns/ipv4.h

index 1085ed4..538ed69 100644 (file)
@@ -57,17 +57,17 @@ struct netns_ipv4 {
        struct mutex            ra_mutex;
 #ifdef CONFIG_IP_MULTIPLE_TABLES
        struct fib_rules_ops    *rules_ops;
-       bool                    fib_has_custom_rules;
-       unsigned int            fib_rules_require_fldissect;
        struct fib_table __rcu  *fib_main;
        struct fib_table __rcu  *fib_default;
+       unsigned int            fib_rules_require_fldissect;
+       bool                    fib_has_custom_rules;
 #endif
        bool                    fib_has_custom_local_routes;
+       bool                    fib_offload_disabled;
 #ifdef CONFIG_IP_ROUTE_CLASSID
        int                     fib_num_tclassid_users;
 #endif
        struct hlist_head       *fib_table_hash;
-       bool                    fib_offload_disabled;
        struct sock             *fibnl;
 
        struct sock  * __percpu *icmp_sk;