[ovs-dev] [PATCH 2/7] ofproto: Lock for vlan splinters only if have them.

Jarno Rajahalme jrajahalme at nicira.com
Thu Feb 13 19:12:04 UTC 2014

Pushed to master.


On Feb 12, 2014, at 9:45 AM, Ben Pfaff <blp at nicira.com> wrote:

> On Wed, Feb 12, 2014 at 08:59:18AM -0800, Jarno Rajahalme wrote:
>> On Feb 11, 2014, at 4:40 PM, Ben Pfaff <blp at nicira.com> wrote:
>>> On Tue, Feb 11, 2014 at 04:30:44PM -0800, Jarno Rajahalme wrote:
>>>> Reading the hmap count for determining if it is empty or not is thread
>>>> safe, so avoid locking when not necessary.
>>>> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
>>> It might be worth adding an atomic_thread_fence(memory_order_acquire);
>>> before the hmap_is_empty() checks, so that we can be sure to get "fresh"
>>> results in case that some other CPU has modified the hmap.  (On x86,
>>> with GCC 4.7, this generates no code.)
>> Would this be best placed in the hmap_is_empty() itself?
> I think that's OK, sure.

More information about the dev mailing list