From patchwork Sun Mar 12 17:33:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bodireddy, Bhanuprakash" X-Patchwork-Id: 737848 X-Patchwork-Delegate: dlu998@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vh7ZN73Ghz9s76 for ; Mon, 13 Mar 2017 04:40:44 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 880B7A15; Sun, 12 Mar 2017 17:40:10 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 497ECA15 for ; Sun, 12 Mar 2017 17:40:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id E8285175 for ; Sun, 12 Mar 2017 17:40:08 +0000 (UTC) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 12 Mar 2017 10:40:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,152,1486454400"; d="scan'208";a="75725088" Received: from silpixa00393942.ir.intel.com (HELO silpixa00393942.ger.corp.intel.com) ([10.237.223.42]) by fmsmga006.fm.intel.com with ESMTP; 12 Mar 2017 10:40:07 -0700 From: Bhanuprakash Bodireddy To: dev@openvswitch.org Date: Sun, 12 Mar 2017 17:33:25 +0000 Message-Id: <1489340008-77897-2-git-send-email-bhanuprakash.bodireddy@intel.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1489340008-77897-1-git-send-email-bhanuprakash.bodireddy@intel.com> References: <1489340008-77897-1-git-send-email-bhanuprakash.bodireddy@intel.com> X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 2/5] dpif-netdev: Reorder elements in dp_netdev structure. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org 'emc_insert_min' variable is made to align on a 64-byte boundary and this introduces a 24 byte hole. This patch moves the emc_insert_min member variable slightly higher in the order to remove the hole and thus saves a cache line with the new ordering. Signed-off-by: Bhanuprakash Bodireddy CC: Ciara Loftus CC: Georg Schmuecking --- lib/dpif-netdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index faadedb..006cea6 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -261,6 +261,9 @@ struct dp_netdev { struct dp_meter *meters[MAX_METERS]; /* Meter bands. */ uint32_t meter_free; /* Next free meter. */ + /* Probability of EMC insertions is a factor of 'emc_insert_min'.*/ + OVS_ALIGNED_VAR(CACHE_LINE_SIZE) atomic_uint32_t emc_insert_min; + /* Protects access to ofproto-dpif-upcall interface during revalidator * thread synchronization. */ struct fat_rwlock upcall_rwlock; @@ -292,9 +295,6 @@ struct dp_netdev { uint64_t last_tnl_conf_seq; struct conntrack conntrack; - - /* Probability of EMC insertions is a factor of 'emc_insert_min'.*/ - OVS_ALIGNED_VAR(CACHE_LINE_SIZE) atomic_uint32_t emc_insert_min; }; static void meter_lock(const struct dp_netdev *dp, uint32_t meter_id)