Skip to contentSkip to conversation

vxlan: fix a soft lockup in vxlan module removal

PATCH Applied Cong Wang 3 participants 3 messages Aug 7, 2013 – Aug 9, 2013

Subsystems (2)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 vxlan: fix a soft lockup in vxlan module removal

From: Cong Wang <[email protected]>

This is a regression introduced by:

	commit fe5c3561e6f0ac7c9546209f01351113c1b77ec8
	Author: stephen hemminger <[email protected]>
	Date:   Sat Jul 13 10:18:18 2013 -0700

	    vxlan: add necessary locking on device removal

The problem is that vxlan_dellink(), which is called with RTNL lock held, tries to flush the workqueue synchronously, but apparently igmp_join and igmp_leave work need to hold RTNL lock too, therefore we have a soft lockup!

As suggested by Stephen, probably the flush_workqueue can just be removed and let the normal refcounting work. The workqueue has a reference to device and socket, therefore the cleanups should work correctly.

---

drivers/net/vxlan.c +0 -2
index 8bf31d9..c51ef9b 100644
@@ -1837,8 +1837,6 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head)
 	struct vxlan_net *vn = net_generic(dev_net(dev), vxlan_net_id);
 	struct vxlan_dev *vxlan = netdev_priv(dev);
 
-	flush_workqueue(vxlan_wq);
-
 	spin_lock(&vn->sock_lock);
 	hlist_del_rcu(&vxlan->hlist);
 	spin_unlock(&vn->sock_lock);
Acked-by on v1 1/1
#1 lore raw
Quoted 32 lines · On Wed, 7 Aug 2013 16:43:22 +0800 Cong Wang <[email protected]> wrote:

From: Cong Wang <[email protected]>

This is a regression introduced by:

	commit fe5c3561e6f0ac7c9546209f01351113c1b77ec8
	Author: stephen hemminger <[email protected]>
	Date:   Sat Jul 13 10:18:18 2013 -0700

	    vxlan: add necessary locking on device removal

The problem is that vxlan_dellink(), which is called with RTNL lock held, tries to flush the workqueue synchronously, but apparently igmp_join and igmp_leave work need to hold RTNL lock too, therefore we have a soft lockup!

As suggested by Stephen, probably the flush_workqueue can just be removed and let the normal refcounting work. The workqueue has a reference to device and socket, therefore the cleanups should work correctly.

---

drivers/net/vxlan.c +0 -0
index 8bf31d9..c51ef9b 100644

drivers/net/vxlan.c static void vxlan_dellink(struct net_device *dev, struct list_head *head) · line 1842

Quoted 8 lines
drivers/net/vxlan.c +0 -2
@@ -1837,8 +1837,6 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head)
 	struct vxlan_net *vn = net_generic(dev_net(dev), vxlan_net_id);
 	struct vxlan_dev *vxlan = netdev_priv(dev);
 
-	flush_workqueue(vxlan_wq);
-
 	spin_lock(&vn->sock_lock);
 	hlist_del_rcu(&vxlan->hlist);
 	spin_unlock(&vn->sock_lock);

Thanks for testing this.

maintainer Applied
#2 lore raw
In reply to Cong Wang

From: Cong Wang <[email protected]>
Date: Wed, 7 Aug 2013 16:43:22 +0800

Quoted 20 lines

From: Cong Wang <[email protected]>

This is a regression introduced by:

	commit fe5c3561e6f0ac7c9546209f01351113c1b77ec8
	Author: stephen hemminger <[email protected]>
	Date:   Sat Jul 13 10:18:18 2013 -0700

	    vxlan: add necessary locking on device removal

The problem is that vxlan_dellink(), which is called with RTNL lock held, tries to flush the workqueue synchronously, but apparently igmp_join and igmp_leave work need to hold RTNL lock too, therefore we have a soft lockup!

As suggested by Stephen, probably the flush_workqueue can just be removed and let the normal refcounting work. The workqueue has a reference to device and socket, therefore the cleanups should work correctly.

Quoted 5 lines

Applied.