net: make unregister netdev warning timeout configurable
authorDmitry Vyukov <dvyukov@google.com>
Tue, 23 Mar 2021 06:49:23 +0000 (07:49 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Mar 2021 00:22:50 +0000 (17:22 -0700)
commit5aa3afe107d9099fc0dea2acf82c3e3c8f0f20e2
tree03a69b161a77f895e1c47c6c0f46eb617207181a
parent4c94fe88cde4bb5c8e1baa01106c4e6db1c75738
net: make unregister netdev warning timeout configurable

netdev_wait_allrefs() issues a warning if refcount does not drop to 0
after 10 seconds. While 10 second wait generally should not happen
under normal workload in normal environment, it seems to fire falsely
very often during fuzzing and/or in qemu emulation (~10x slower).
At least it's not possible to understand if it's really a false
positive or not. Automated testing generally bumps all timeouts
to very high values to avoid flake failures.
Add net.core.netdev_unregister_timeout_secs sysctl to make
the timeout configurable for automated testing systems.
Lowering the timeout may also be useful for e.g. manual bisection.
The default value matches the current behavior.

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=211877
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/admin-guide/sysctl/net.rst
include/linux/netdevice.h
net/core/dev.c
net/core/sysctl_net_core.c