[ovs-dev] [PATCH 2/2] netdev: Fix potential deadlock.

William Tu u9012063 at gmail.com
Mon May 9 21:33:45 UTC 2016


Hi Ben and Ryan,

I've reviewed and tested this patch. It works fine with Helgrind error
resolved.
I applied the to commit 790c5d269 and chunk #4 failed. Since it doesn't do
anything, so I simply ignore it.

Regards,
William


On Sat, Apr 23, 2016 at 2:00 PM, Ryan Moats <rmoats at us.ibm.com> wrote:

> "dev" <dev-bounces at openvswitch.org> wrote on 04/22/2016 07:04:09 PM:
>
> > From: Ben Pfaff <blp at ovn.org>
> > To: dev at openvswitch.org
> > Cc: Ben Pfaff <blp at ovn.org>
> > Date: 04/22/2016 07:04 PM
> > Subject: [ovs-dev] [PATCH 2/2] netdev: Fix potential deadlock.
> > Sent by: "dev" <dev-bounces at openvswitch.org>
> >
> > Until now, netdev_class_mutex and route_table_mutex could be taken in
> > either order:
> >
> >     * netdev_run() takes netdev_class_mutex, then netdev_vport_run()
> calls
> >       route_table_run(), which takes route_table_mutex.
> >
> >     * route_table_init() takes route_table_mutex and then eventually
> calls
> >       netdev_open(), which takes netdev_class_mutex.
> >
> > This commit fixes the problem by converting the netdev_classes hmap,
> > protected by netdev_class_mutex, into a cmap protected on the read
> > side by RCU.  Only a very small amount of code actually writes to the
> > cmap in question, so it's a lot easier to understand the locking rules
> > at that point.  In particular, there's no need to take netdev_class_mutex
> > from either netdev_run() or netdev_open(), so neither of the code paths
> > above determines a lock ordering any longer.
> >
> > Reported-by: William Tu <u9012063 at gmail.com>
> > Reported-at: http://openvswitch.org/pipermail/discuss/2016-February/
> > 020216.html
> > Signed-off-by: Ben Pfaff <blp at ovn.org>
>
> Yep, this one too...
>
> Acked-by: Ryan Moats <rmoats at us.ibm.com>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>



More information about the dev mailing list