From patchwork Fri Oct 14 14:37:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bodireddy, Bhanuprakash" X-Patchwork-Id: 682310 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 3swVfq1lJBz9s9x for ; Sat, 15 Oct 2016 01:41:55 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 0AA21106E5; Fri, 14 Oct 2016 07:41:35 -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 42457106E5 for ; Fri, 14 Oct 2016 07:41:34 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id CE51B420557 for ; Fri, 14 Oct 2016 08:41:33 -0600 (MDT) X-ASG-Debug-ID: 1476456093-09eadd617c154d0001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar5.cudamail.com with ESMTP id APVbNuALhaQufOUM (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 14 Oct 2016 08:41:33 -0600 (MDT) X-Barracuda-Envelope-From: bhanuprakash.bodireddy@intel.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mga03.intel.com) (134.134.136.65) by mx3-pf3.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 14 Oct 2016 14:41:32 -0000 Received-SPF: pass (mx3-pf3.cudamail.com: SPF record at intel.com designates 134.134.136.65 as permitted sender) X-Barracuda-Apparent-Source-IP: 134.134.136.65 X-Barracuda-RBL-IP: 134.134.136.65 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP; 14 Oct 2016 07:41:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,493,1473145200"; d="scan'208";a="19585758" Received: from silpixa00393942.ir.intel.com ([10.237.223.42]) by fmsmga006.fm.intel.com with ESMTP; 14 Oct 2016 07:41:31 -0700 X-CudaMail-Envelope-Sender: bhanuprakash.bodireddy@intel.com From: Bhanuprakash Bodireddy To: dev@openvswitch.org X-CudaMail-MID: CM-V3-1013015281 X-CudaMail-DTE: 101416 X-CudaMail-Originating-IP: 134.134.136.65 Date: Fri, 14 Oct 2016 15:37:09 +0100 X-ASG-Orig-Subj: [##CM-V3-1013015281##][PATCH v3 06/12] cmap: Remove prefetching in cmap_find_batch(). Message-Id: <1476455835-77641-7-git-send-email-bhanuprakash.bodireddy@intel.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1476455835-77641-1-git-send-email-bhanuprakash.bodireddy@intel.com> References: <1476455835-77641-1-git-send-email-bhanuprakash.bodireddy@intel.com> X-GBUdb-Analysis: 0, 134.134.136.65, Ugly c=0 p=0 Source New X-MessageSniffer-Rules: 0-0-0-5281-c X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1476456093 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: 1.10 X-Barracuda-Spam-Status: No, SCORE=1.10 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_RULE_7582B, BSF_SC5_MJ1963, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.33711 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE_7582B Custom Rule 7582B 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 v3 06/12] cmap: Remove prefetching in cmap_find_batch(). 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" prefetching the data in to the caches isn't improving the performance in cmap_find_batch(). Moreover its found that there is slight improvement in performance with out prefetching. This patch removes prefetching from cmap_find_batch(). Signed-off-by: Bhanuprakash Bodireddy Co-authored-by: Antonio Fischetti Signed-off-by: Antonio Fischetti --- lib/cmap.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/cmap.c b/lib/cmap.c index 8c7312d..8097b56 100644 --- a/lib/cmap.c +++ b/lib/cmap.c @@ -393,11 +393,10 @@ cmap_find_batch(const struct cmap *cmap, unsigned long map, const struct cmap_bucket *b2s[sizeof map * CHAR_BIT]; uint32_t c1s[sizeof map * CHAR_BIT]; - /* Compute hashes and prefetch 1st buckets. */ + /* Compute hashes. */ ULLONG_FOR_EACH_1(i, map) { h1s[i] = rehash(impl, hashes[i]); b1s[i] = &impl->buckets[h1s[i] & impl->mask]; - OVS_PREFETCH(b1s[i]); } /* Lookups, Round 1. Only look up at the first bucket. */ ULLONG_FOR_EACH_1(i, map) { @@ -411,15 +410,13 @@ cmap_find_batch(const struct cmap *cmap, unsigned long map, } while (OVS_UNLIKELY(counter_changed(b1, c1))); if (!node) { - /* Not found (yet); Prefetch the 2nd bucket. */ + /* Not found (yet). */ b2s[i] = &impl->buckets[other_hash(h1s[i]) & impl->mask]; - OVS_PREFETCH(b2s[i]); c1s[i] = c1; /* We may need to check this after Round 2. */ continue; } /* Found. */ ULLONG_SET0(map, i); /* Ignore this on round 2. */ - OVS_PREFETCH(node); nodes[i] = node; } /* Round 2. Look into the 2nd bucket, if needed. */ @@ -453,7 +450,6 @@ cmap_find_batch(const struct cmap *cmap, unsigned long map, continue; } found: - OVS_PREFETCH(node); nodes[i] = node; } return result;