Skip to contentSkip to conversation

net: avoid weird emergency message

PATCH Applied Eric Dumazet 2 participants 2 messages May 16, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: avoid weird emergency message

When host is under high stress, it is very possible thread running netdev_wait_allrefs() returns from msleep(250) 10 seconds late.

This leads to these messages in the syslog :

[...] unregister_netdevice: waiting for syz_tun to become free. Usage count = 0

If the device refcount is zero, the wait is over.

---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +1 -1
index 108ac8137b9be8bc7041b3e49e09c25eeb891d8f..b6b8505cfb3e2394f74b41b8e01055c697ad384b 100644
@@ -8927,7 +8927,7 @@ static void netdev_wait_allrefs(struct net_device *dev)
 
 		refcnt = netdev_refcnt_read(dev);
 
-		if (time_after(jiffies, warning_time + 10 * HZ)) {
+		if (refcnt && time_after(jiffies, warning_time + 10 * HZ)) {
 			pr_emerg("unregister_netdevice: waiting for %s to become free. Usage count = %d\n",
 				 dev->name, refcnt);
 			warning_time = jiffies;
Signature · 1 line
2.21.0.1020.gf2820cf01a-goog
maintainer Applied
#1 lore raw

From: Eric Dumazet <[email protected]>
Date: Thu, 16 May 2019 08:09:57 -0700

Quoted 4 lines

When host is under high stress, it is very possible thread running netdev_wait_allrefs() returns from msleep(250) 10 seconds late.

Quoted 8 lines

This leads to these messages in the syslog :

[...] unregister_netdevice: waiting for syz_tun to become free. Usage count = 0

If the device refcount is zero, the wait is over.

Applied, thanks.