From: Jarno Rajahalme Date: Wed, 19 Mar 2014 15:51:52 +0000 (-0700) Subject: lib/hmap: Remove the memory fence from hmap_is_empty(). X-Git-Tag: sliver-openvswitch-2.2.90-1~6^2~77 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=543ede7e3eaac62c14a061296722839829b0cef8;p=sliver-openvswitch.git lib/hmap: Remove the memory fence from hmap_is_empty(). 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 Signed-off-by: Ben Pfaff --- diff --git a/lib/hmap.h b/lib/hmap.h index 445e74f0b..9fb83d5ab 100644 --- a/lib/hmap.h +++ b/lib/hmap.h @@ -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; }