From patchwork Fri Oct 7 16:17:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bodireddy, Bhanuprakash" X-Patchwork-Id: 679477 X-Patchwork-Delegate: diproiettod@vmware.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3srFCv6XLfz9s65 for ; Sat, 8 Oct 2016 03:22:19 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 64D9B10A14; Fri, 7 Oct 2016 09:21:15 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id D05E810A03 for ; Fri, 7 Oct 2016 09:21:12 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 6134B420791 for ; Fri, 7 Oct 2016 10:21:12 -0600 (MDT) X-ASG-Debug-ID: 1475857271-09eadd489d0e740001-byXFYA Received: from mx3-pf1.cudamail.com ([192.168.14.2]) by bar5.cudamail.com with ESMTP id cKSC5IoyIaD48jlC (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 07 Oct 2016 10:21:11 -0600 (MDT) X-Barracuda-Envelope-From: bhanuprakash.bodireddy@intel.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.2 Received: from unknown (HELO mga05.intel.com) (192.55.52.43) by mx3-pf1.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 7 Oct 2016 16:21:11 -0000 Received-SPF: pass (mx3-pf1.cudamail.com: SPF record at intel.com designates 192.55.52.43 as permitted sender) X-Barracuda-Apparent-Source-IP: 192.55.52.43 X-Barracuda-RBL-IP: 192.55.52.43 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 07 Oct 2016 09:21:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,456,1473145200"; d="scan'208";a="177488378" Received: from silpixa00393942.ir.intel.com ([10.237.223.42]) by fmsmga004.fm.intel.com with ESMTP; 07 Oct 2016 09:21:11 -0700 X-CudaMail-Envelope-Sender: bhanuprakash.bodireddy@intel.com From: Bhanuprakash Bodireddy To: dev@openvswitch.org X-CudaMail-MID: CM-V1-1006023433 X-CudaMail-DTE: 100716 X-CudaMail-Originating-IP: 192.55.52.43 Date: Fri, 7 Oct 2016 17:17:41 +0100 X-ASG-Orig-Subj: [##CM-V1-1006023433##][PATCH 11/12] netlink-socket: Reorder elements in nl_dump structure. Message-Id: <1475857062-55311-12-git-send-email-bhanuprakash.bodireddy@intel.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1475857062-55311-1-git-send-email-bhanuprakash.bodireddy@intel.com> References: <1475857062-55311-1-git-send-email-bhanuprakash.bodireddy@intel.com> X-GBUdb-Analysis: 0, 192.55.52.43, Ugly c=0.308711 p=-0.3 Source Normal X-MessageSniffer-Rules: 0-0-0-4091-c X-Barracuda-Connect: UNKNOWN[192.168.14.2] X-Barracuda-Start-Time: 1475857271 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.33545 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Subject: [ovs-dev] [PATCH 11/12] netlink-socket: Reorder elements in nl_dump structure. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" 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 Signed-off-by: Antonio Fischetti Acked-by: Jarno Rajahalme --- lib/netlink-socket.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/netlink-socket.h b/lib/netlink-socket.h index f73fc7d..d3cc642 100644 --- a/lib/netlink-socket.h +++ b/lib/netlink-socket.h @@ -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,