mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
net: add CONFIG_PCPU_DEV_REFCNT
I was working on a syzbot issue, claiming one device could not be dismantled because its refcount was -1 unregister_netdevice: waiting for sit0 to become free. Usage count = -1 It would be nice if syzbot could trigger a warning at the time this reference count became negative. This patch adds CONFIG_PCPU_DEV_REFCNT options which defaults to per cpu variables (as before this patch) on SMP builds. v2: free_dev label in alloc_netdev_mqs() is moved to avoid a compiler warning (-Wunused-label), as reported by kernel test robot <lkp@intel.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
942f0c6e28
commit
919067cc84
@@ -245,6 +245,14 @@ source "net/l3mdev/Kconfig"
|
||||
source "net/qrtr/Kconfig"
|
||||
source "net/ncsi/Kconfig"
|
||||
|
||||
config PCPU_DEV_REFCNT
|
||||
bool "Use percpu variables to maintain network device refcount"
|
||||
depends on SMP
|
||||
default y
|
||||
help
|
||||
network device refcount are using per cpu variables if this option is set.
|
||||
This can be forced to N to detect underflows (with a performance drop).
|
||||
|
||||
config RPS
|
||||
bool
|
||||
depends on SMP && SYSFS
|
||||
|
Reference in New Issue
Block a user