NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/54495: stopping axe(4) may locks up if NET_MPSAFE is enabled



>Number:         54495
>Category:       kern
>Synopsis:       stopping axe(4) may locks up if NET_MPSAFE is enabled
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 28 06:15:00 +0000 2019
>Originator:     sc.dying%gmail.com@localhost
>Release:        NetBSD 9.99.10
>Organization:
>Environment:
	Boardtype: Raspberry Pi 3 Model B Rev 1.2
	System: NetBSD-earmv7hf/9.99.10 (GENERIC) with NET_MPSAFE enabled
	Architecture: earmv7hf
	Machine: evbarm
>Description:
The command `ifconfig axe0 down' often locks up on NET_MPSAFE kernel.

Suspicious processes are ifconfig and softclock.  It looks like that
ifconfig thread holds unp_lock and waits for kpause is waked up,
and usbnet_tick waits for unp_lock released to hold it.
usbnet_stop() sets unp_stopping, but usbnet_tick() checks it after
mutex_enter(unp_lock), so softclock thread is stalled.

The problem is easily reproduced because my axe(4) uses AX88772B so axe
kpauses 600ms at least in axe_reset if NET_MPSAFE is defined.


crash> ps
PID    LID S CPU     FLAGS       STRUCT LWP *               NAME WAIT
15   >   1 7   0         0           911be120              crash
13       1 3   0         0           90fe9700           ifconfig usbdly
6        1 3   0        80           90e0b3c0                 sh wait
1        1 3   0        80           90fab420               init wait
0       92 3   3       200           90fe9440          pooldrain pooldrain
0       91 3   3       200           90fe9180           aiodoned aiodoned
0       90 3   0       200           90fe8ec0            ioflush syncer
0       89 3   3       200           90fe8c00           pgdaemon pgdaemon
0       88 3   1       280           90e50620          VCHIQka-0 lnxcmplt
0       87 3   3       280           90fe8940            vcaudio data
0       86 3   0       280           90fe8680           VCHIQs-0 semacv
0       85 3   3       280           90fe83c0           VCHIQr-0 semacv
0       84 3   0       280           90fe8100            VCHIQ-0 semacv
0       83 5   0       200           90fabc60           (zombie)
0       81 3   3       200           90fab9a0               usb0 usbevt
0       80 3   2       200           90fab6e0            npfgc-0 npfgccv
0       79 3   0       200           90fab160            rt_free rt_free
0       78 3   0       200           90faaea0              unpgc unpgc
0       77 3   0       200           90faabe0    key_timehandler key_timehandler
0       76 3   3       200           90faa920    icmp6_wqinput/3 icmp6_wqinput
0       75 3   2       200           90faa660    icmp6_wqinput/2 icmp6_wqinput
0       74 3   1       200           90faa3a0    icmp6_wqinput/1 icmp6_wqinput
0       73 3   0       200           90e500a0    icmp6_wqinput/0 icmp6_wqinput
0       72 3   0       200           90faa0e0          nd6_timer nd6_timer
0       71 3   3       200           90e73c40    carp6_wqinput/3 carp6_wqinput
0       70 3   2       200           90e73980    carp6_wqinput/2 carp6_wqinput
0       69 3   1       200           90e736c0    carp6_wqinput/1 carp6_wqinput
0       68 3   0       200           90e73400    carp6_wqinput/0 carp6_wqinput
0       67 3   3       200           90e73140     carp_wqinput/3 carp_wqinput
0       66 3   2       200           90e72e80     carp_wqinput/2 carp_wqinput
0       65 3   1       200           90e72bc0     carp_wqinput/1 carp_wqinput
0       64 3   0       200           90e72900     carp_wqinput/0 carp_wqinput
0       63 3   0       200           90e72640       tcp_slowtimo tcp_slowtimo
0       62 3   3       200           90e72380     icmp_wqinput/3 icmp_wqinput
0       61 3   2       200           90e720c0     icmp_wqinput/2 icmp_wqinput
0       60 3   1       200           90e51c20     icmp_wqinput/1 icmp_wqinput
0       59 3   0       200           90e51960     icmp_wqinput/0 icmp_wqinput
0       58 3   0       200           90e516a0           rt_timer rt_timer
0       56 3   2       200           90e508e0        vmem_rehash vmem_rehash
0       55 3   1       200           90e50360            vcmbox0 vcmbox0
0       54 3   0       200           90e513e0         usbtask-dr usbtsk
0       53 3   0       200           90e51120         usbtask-hc usbtsk
0       52 3   0       200           90e50e60               dwc2 dwc2
0       51 3   0       200           90e50ba0             sdmmc1 mmctaskq
0       50 3   0       200           90e0b100             sdmmc0 mmctaskq
0       40 3   0       200           90e0ae40               iic2 iicintr
0       39 3   0       200           90e0ab80               iic1 iicintr
0       38 3   0       200           90e0a8c0               iic0 iicintr
0       37 3   3       200           90e0a600            xcall/3 xcall
0       36 1   3       200           90e0a340          softser/3
0       35 1   3       200           90e0a080          softclk/3
0       34 1   3       200           90b85be0          softbio/3
0       33 1   3       200           90b85920          softnet/3
0    >  32 7   3       201           90b85660             idle/3
0       31 3   2       200           90b853a0            xcall/2 xcall
0       30 1   2       200           90b850e0          softser/2
0       29 1   2       200           90b84e20          softclk/2
0       28 1   2       200           90b84b60          softbio/2
0       27 1   2       200           90b848a0          softnet/2
0    >  26 7   2       201           90b845e0             idle/2
0       25 3   1       200           90b84320            xcall/1 xcall
0       24 1   1       200           90b84060          softser/1
0       23 1   1       200           90b6bbc0          softclk/1
0       22 1   1       200           90b6b900          softbio/1
0       21 1   1       200           90b6b640          softnet/1
0    >  20 7   1       201           90b6b380             idle/1
0       19 3   2       200           90b6b0c0           lnxpwrwq lnxpwrwq
0       18 3   1       200           90b6ae00           lnxlngwq lnxlngwq
0       17 3   0       200           90b6ab40           lnxsyswq lnxsyswq
0       16 3   0       200           90b6a880           lnxrcugc lnxrcugc
0       15 3   0       200           90b6a5c0             sysmon smtaskq
0       14 3   2       200           90b6a300         pmfsuspend pmfsuspend
0       13 3   3       200           90b6a040           pmfevent pmfevent
0       12 3   0       200           90b57ba0         sopendfree sopendfr
0       11 3   0       200           90b578e0           nfssilly nfssilly
0       10 3   0       200           90b57620            cachegc cachegc
0        9 3   0       200           90b57360             vdrain vdrain
0        8 3   0       200           90b570a0          modunload mod_unld
0        7 3   0       200           90b56de0            xcall/0 xcall
0        6 1   0       200           90b56b20          softser/0
0        5 3   0       200           90b56860          softclk/0 tstile
0        4 1   0       200           90b565a0          softbio/0
0        3 1   0       200           90b562e0          softnet/0
0        2 1   0       201           90b56020             idle/0
0        1 3   3       200           807cad80            swapper uvm

crash> bt/a 90fe9700
trace: pid 13 lid 1 at 0x9ae7fbb4
0x9ae7fbb4: mi_switch+0x10
0x9ae7fbe4: sleepq_block+0x110
0x9ae7fc24: kpause+0x138
0x9ae7fc64: axe_ax_init+0x79c
0x9ae7fc7c: axe_stop+0x20
0x9ae7fcac: usbnet_stop+0x7c
0x9ae7fccc: usbnet_stop_ifp+0x34
0x9ae7fce4: ether_ioctl_reinit+0x60
0x9ae7fd04: usbnet_ioctl+0x3c
0x9ae7fe24: doifioctl+0x8c8
0x9ae7feec: sys_ioctl+0x424
0x9ae7ffac: syscall+0x12c
--- tf 0x9ae7ffb0 ---

crash> bt/a 90b56860
trace: pid 0 lid 5 at 0x99de3df4
0x99de3df4: mi_switch+0x10
0x99de3e24: sleepq_block+0xb4
0x99de3e74: turnstile_block+0x4c4
0x99de3ee4: mutex_enter+0x234
0x99de3efc: usbnet_tick+0x1c
0x99de3f44: callout_softclock+0x134
0x99de3fac: softint_dispatch+0x120
Bad frame pointer: 0x80b41f04


>How-To-Repeat:
Build the kernel with NET_MPSAFE enabled, connect axe(4), and
repeat ifconfig it up and down.

>Fix:



Home | Main Index | Thread Index | Old Index