lib/hmap: Remove the memory fence from hmap_is_empty().
authorJarno Rajahalme <jrajahalme@nicira.com>
Wed, 19 Mar 2014 15:51:52 +0000 (08:51 -0700)
committerJarno Rajahalme <jrajahalme@nicira.com>
Wed, 19 Mar 2014 15:51:52 +0000 (08:51 -0700)
The fence made classifier_lookup() slower.  Access to a size_t 'n' is
safe without synchonizing, and if racing with writers matters,
additional syncronization primitives are used anyway.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/hmap.h

index 445e74f..9fb83d5 100644 (file)
@@ -196,7 +196,6 @@ hmap_capacity(const struct hmap *hmap)
 static inline bool
 hmap_is_empty(const struct hmap *hmap)
 {
-    atomic_thread_fence(memory_order_acquire);
     return hmap->n == 0;
 }