Skip to content

Commit e316dd1

Browse files
kuba-moodavem330
authored andcommitted
net: don't dump stack on queue timeout
The top syzbot report for networking (#14 for the entire kernel) is the queue timeout splat. We kept it around for a long time, because in real life it provides pretty strong signal that something is wrong with the driver or the device. Removing it is also likely to break monitoring for those who track it as a kernel warning. Nevertheless, WARN()ings are best suited for catching kernel programming bugs. If a Tx queue gets starved due to a pause storm, priority configuration, or other weirdness - that's obviously a problem, but not a problem we can fix at the kernel level. Bite the bullet and convert the WARN() to a print. Before: NETDEV WATCHDOG: eni1np1 (netdevsim): transmit queue 0 timed out 1975 ms WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:525 dev_watchdog+0x39e/0x3b0 [... completely pointless stack trace of a timer follows ...] Now: netdevsim netdevsim1 eni1np1: NETDEV WATCHDOG: CPU: 0: transmit queue 0 timed out 1769 ms Alternatively we could mark the drivers which syzbot has learned to abuse as "print-instead-of-WARN" selectively. Reported-by: [email protected] Reviewed-by: Jiri Pirko <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Reviewed-by: Jamal Hadi Salim <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8d5855a commit e316dd1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/sched/sch_generic.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,9 @@ static void dev_watchdog(struct timer_list *t)
522522

523523
if (unlikely(timedout_ms)) {
524524
trace_net_dev_xmit_timeout(dev, i);
525-
WARN_ONCE(1, "NETDEV WATCHDOG: %s (%s): transmit queue %u timed out %u ms\n",
526-
dev->name, netdev_drivername(dev), i, timedout_ms);
525+
netdev_crit(dev, "NETDEV WATCHDOG: CPU: %d: transmit queue %u timed out %u ms\n",
526+
raw_smp_processor_id(),
527+
i, timedout_ms);
527528
netif_freeze_queues(dev);
528529
dev->netdev_ops->ndo_tx_timeout(dev, i);
529530
netif_unfreeze_queues(dev);

0 commit comments

Comments
 (0)