-
Notifications
You must be signed in to change notification settings - Fork 129
Commit 2958798
committed
Unregister efrm-nondl on shutdown / reboot
On shutdown / reboot, if netdevs don't have a refcount of 1, the
kernel loops with message:
unregister_netdevice: waiting for eth0 to become free. Usage count = 3
unregister_netdevice: waiting for eth0 to become free. Usage count = 3
unregister_netdevice: waiting for eth0 to become free. Usage count = 3
[...]
With netdev refcount tracking, the traces are visible:
unregister_netdevice: waiting for eth0 to become free. Usage count = 3
ref_tracker: eth%d@ff3cf768c8344548 has 1/2 users at
efrm_nic_add+0x29b/0x460 [sfc_resource]
efrm_nondl_add_device+0x124/0x1c0 [sfc_resource]
efrm_nondl_try_add_device+0x27/0xf0 [sfc_resource]
efrm_nondl_register_netdev+0x106/0x160 [sfc_resource]
nondl_register_store+0x174/0x1e0 [sfc_resource]
kernfs_fop_write_iter+0x128/0x1c0
vfs_write+0x308/0x420
ksys_write+0x5f/0xe0
do_syscall_64+0x7b/0x160
entry_SYSCALL_64_after_hwframe+0x76/0x7e
ref_tracker: eth%d@ff3cf768c8344548 has 1/2 users at
efrm_nondl_register_netdev+0xa9/0x160 [sfc_resource]
nondl_register_store+0x174/0x1e0 [sfc_resource]
kernfs_fop_write_iter+0x128/0x1c0
vfs_write+0x308/0x420
ksys_write+0x5f/0xe0
do_syscall_64+0x7b/0x160
entry_SYSCALL_64_after_hwframe+0x76/0x7e
This patch makes sfc_resource register a reboot notifier that calls
efrm_nondl_unregister & efrm_nondl_shutdown that handles each of the two
refcounts. Considering that the only other caller of those functions
is the cleanup_sfc_resource module exit function, I don't think shutdown
should be concerned about module unload racing under normal circumstances.
Signed-off-by: YiFei Zhu <zhuyifei@google.com>1 parent 4ab93d8 commit 2958798
1 file changed
+20
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | + | ||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
631 | 632 | | |
632 | 633 | | |
633 | 634 | | |
635 | + | ||
636 | + | ||
637 | + | ||
638 | + | ||
639 | + | ||
640 | + | ||
641 | + | ||
642 | + | ||
643 | + | ||
644 | + | ||
645 | + | ||
646 | + | ||
647 | + | ||
648 | + | ||
649 | + | ||
634 | 650 | | |
635 | 651 | | |
636 | 652 | | |
| |||
683 | 699 | | |
684 | 700 | | |
685 | 701 | | |
702 | + | ||
703 | + | ||
686 | 704 | | |
687 | 705 | | |
688 | 706 | | |
| |||
705 | 723 | | |
706 | 724 | | |
707 | 725 | | |
726 | + | ||
727 | + | ||
708 | 728 | | |
709 | 729 | | |
710 | 730 | | |
| |||
0 commit comments