]> git.proxmox.com Git - ovs.git/commitdiff
netlink-socket: Reorder elements in nl_dump structure.
authorBhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Fri, 14 Oct 2016 14:37:14 +0000 (15:37 +0100)
committerDaniele Di Proietto <diproiettod@vmware.com>
Tue, 18 Oct 2016 01:35:18 +0000 (18:35 -0700)
By reordering the elements in nl_dump structure, pad bytes can be
reduced there by saving a cache line.

Before: structure size:72, holes:1, sum padbytes:4, cachelines:2
After: structure size:64, holes:0, sum padbytes:0, cachelines:1

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
lib/netlink-socket.h

index f73fc7d99ff0985f3f790c6a9e0c65c11fa958be..d3cc642886d7040ae20270efb020f5f0c68eef95 100644 (file)
@@ -260,12 +260,12 @@ struct nl_dump {
     /* These members are immutable during the lifetime of the nl_dump. */
     struct nl_sock *sock;       /* Socket being dumped. */
     uint32_t nl_seq;            /* Expected nlmsg_seq for replies. */
-
-    /* 'mutex' protects 'status' and serializes access to 'sock'. */
-    struct ovs_mutex mutex;     /* Protects 'status', synchronizes recv(). */
     int status OVS_GUARDED;     /* 0: dump in progress,
                                  * positive errno: dump completed with error,
                                  * EOF: dump completed successfully. */
+
+    /* 'mutex' protects 'status' and serializes access to 'sock'. */
+    struct ovs_mutex mutex;     /* Protects 'status', synchronizes recv(). */
 };
 
 void nl_dump_start(struct nl_dump *, int protocol,