[ovs-dev] [PATCH v3] datapath: Simplify datapath locking.

Pravin Shelar pshelar at nicira.com
Wed Apr 10 18:51:15 UTC 2013


On Wed, Apr 10, 2013 at 10:32 AM, Jesse Gross <jesse at nicira.com> wrote:

> On Wed, Apr 10, 2013 at 9:01 AM, Jesse Gross <jesse at nicira.com> wrote:
> > On Tue, Apr 9, 2013 at 9:04 PM, Pravin Shelar <pshelar at nicira.com>
> wrote:
> >> On Tue, Apr 9, 2013 at 6:41 PM, Jesse Gross <jesse at nicira.com> wrote:
> >>> I think there is potentially another race condition here: if a
> >>> notification comes after we retrieve the value of count but before we
> >>> exit the workqueue. The counter will be incremented but another work
> >>> instance won't be scheduled since one is already running. Essentially
> >>> we're trying to emulate a semaphore here but actually doing that
> >>> directly would require introducing a new thread, which I really don't
> >>> want to do.
> >>>
> >> Pending flag is cleared before actual work execution is started. So I
> think
> >> this race is not possible.
> >
> > You're right, that's great. We should also double check that our
> > compatibility code for workqueues is sufficient for everything we are
> > trying to do.
>
> Actually, I think that this means that we don't need the counters at
> all.  If a port is deleted after we start iterating then we'll always
> get another pass.  I noticed a similar example of this in
> net_namespace.c:__put_net().
>

right, I will remove counter.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130410/ea62018f/attachment-0003.html>


More information about the dev mailing list