[ovs-dev] [PATCH 06/12] cmap: Remove prefetching in cmap_find_batch().

Bhanuprakash Bodireddy bhanuprakash.bodireddy at intel.com
Fri Oct 7 16:17:36 UTC 2016


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 <bhanuprakash.bodireddy at intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti at intel.com>
---
 lib/cmap.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/lib/cmap.c b/lib/cmap.c
index 8c7312d..4c34bda 100644
--- a/lib/cmap.c
+++ b/lib/cmap.c
@@ -397,7 +397,6 @@ cmap_find_batch(const struct cmap *cmap, unsigned long map,
     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) {
@@ -413,13 +412,11 @@ cmap_find_batch(const struct cmap *cmap, unsigned long map,
         if (!node) {
             /* Not found (yet); Prefetch the 2nd bucket. */
             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;
-- 
2.4.11




More information about the dev mailing list