On Mon, Nov 20, 2017 at 04:22:25PM +0100, Martin Pieuchot wrote:
> Diff below remove the KERNEL_LOCK() around all pr_input() routines.
> It's a bit rough so I'd appreciate more tests before splitting it into
> pieces.

regress/lib/libpthread runs into a deadlock:

===> socket/1
cc -O2 -pipe  -I/usr/src/regress/lib/libpthread/socket/1/../../include -Wall  
-DSRCDIR='"/usr/src/regress/lib/libpthread/socket/1"' 
-I/usr/src/regress/lib/libpthread/socket/1/../include  -MD -MP  -c 
/usr/src/regress/lib/libpthread/socket/1/socket1.c
cc   -o socket1 socket1.o -lpthread
./socket1

A lot of processes are waiting for the net lock:

ddb{0}> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
 92841   53206      1      0  3        0x82  thrsleep      socket1
 92841   34582      1      0  3   0x4000082  netcon        socket1
 92841  427059      1      0  3   0x4000002  netlock       socket1
 17869  237863  64620      0  3    0x100082  piperd        gzip
 64620  287694  20261      0  3    0x100082  piperd        pax
 20261  394098  49123      0  3        0x82  pipewr        perl
 49123   39681  68118      0  3    0x10008a  pause         ksh
 68118  101874   6279      0  3        0x52  netlock       sshd
 71426  167931      1      0  3        0x83  netio         login
 47052   97105      1      0  3    0x100083  ttyin         getty
  4929  501560      1      0  3    0x100083  ttyin         getty
 17447  409940      1      0  3    0x100083  ttyin         getty
  3248  432204      1      0  3    0x100083  ttyin         getty
 92079  257598      1      0  3    0x100083  ttyin         getty
 29168  457419      1      0  3    0x100098  poll          cron
 10039  371687      1     99  3    0x100090  poll          sndiod
 84840  178202      1    110  3    0x100090  poll          sndiod
 29145   32675  41152     95  3    0x100092  kqread        smtpd
 64178  437103  41152    103  3    0x100092  kqread        smtpd
 70671  253152  41152     95  3    0x100092  kqread        smtpd
 58596  268547  41152     95  3    0x100092  kqread        smtpd
 69700   24499  41152     95  3    0x100092  kqread        smtpd
 92805  258698  41152     95  3    0x100092  kqread        smtpd
 41152  475143      1      0  3    0x100080  kqread        smtpd
  6279   90305      1      0  3        0x80  select        sshd
 92796  374585      0      0  3     0x14200  acct          acct
 59546   95746      0      0  3     0x14280  nfsidl        nfsio
 58735  375345      0      0  3     0x14280  nfsidl        nfsio
  6690  353929      0      0  3     0x14280  nfsidl        nfsio
 12672   42719      0      0  3     0x14280  nfsidl        nfsio
 70271  450856      1      0  3    0x100080  poll          ntpd
 72004  124611  70995     83  3    0x100092  poll          ntpd
 70995   25369      1     83  3    0x100012  netlock       ntpd
 75907  420740  97225     74  3    0x100092  bpf           pflogd
 97225  518514      1      0  3        0x80  netio         pflogd
 46707  301105  82852     73  3    0x100090  kqread        syslogd
 82852   52006      1      0  3    0x100082  netio         syslogd
   633  227768      1     77  3    0x100090  poll          dhclient
 44449   13774      1      0  3        0x80  poll          dhclient
 32381   23590  25453    115  3    0x100092  kqread        slaacd
 64762  226200  25453    115  3    0x100092  kqread        slaacd
 25453   18123      1      0  3        0x80  kqread        slaacd
 92740  239333      0      0  3     0x14200  bored         ttm_swap
 72784   47424      0      0  3     0x14200  pgzero        zerothread
   596  230658      0      0  3     0x14200  aiodoned      aiodoned
 34515  469546      0      0  3     0x14200  syncer        update
 26581  499471      0      0  3     0x14200  cleaner       cleaner
 81584  406555      0      0  3     0x14200  reaper        reaper
 66383  338329      0      0  3     0x14200  pgdaemon      pagedaemon
 77049  251648      0      0  3     0x14200  bored         crynlk
 65487  523752      0      0  3     0x14200  bored         crypto
 82067  365041      0      0  3     0x14200  usbtsk        usbtask
 67863  195584      0      0  3     0x14200  usbatsk       usbatsk
  4602  167235      0      0  3     0x14200  bored         sensors
  1303  467637      0      0  3  0x40014200  acpi0         acpi0
 61494  169229      0      0  7  0x40014200                idle1
 97874  376418      0      0  3     0x14200  tqbar         softnet
 37711   87043      0      0  3     0x14200  bored         systqmp
 37542  272189      0      0  3     0x14200  netlock       systq
 12285   95321      0      0  3  0x40014200  netlock       softclock
*71200  301193      0      0  7  0x40014200                idle0
   840   20751      0      0  3     0x14200  bored         sbar
 16875  348937      0      0  3     0x14200  kmalloc       kmthread
     1  172792      0      0  3        0x82  wait          init
     0       0     -1      0  3     0x10200  scheduler     swapper

softnet is holding the net lock:

ddb{0}> x/x netlock,2
netlock:        d58009bf
netlock+0x4:    d0b793b4

 376418  softnet            0xd58009bc          0xf52fe000          0xd0d18534

softnet is waiting for the task barrier:

ddb{0}> trace /p 0t376418
sleep_finish(f5300874,f5300878) at sleep_finish+0x62
sleep_finish(f5300878,1) at sleep_finish+0x62
taskq_barrier(d0bfe1b8) at taskq_barrier+0x9b
sofree(d54b5b98) at sofree+0x72
in_pcbdetach(d579ac40) at in_pcbdetach+0x47
tcp_close(d5619c60) at tcp_close+0x102
tcp_input(f5300a3c,f5300a38,6,2) at tcp_input+0x194b
ip_deliver(f5300a3c,f5300a38,6,2) at ip_deliver+0x21f
ip_local(f5300a3c,f5300a38,d094e188,0) at ip_local+0x139
ipintr() at ipintr+0x54
if_netisr(0) at if_netisr+0
db_enter() at db_enter+0x4

bluhm

Reply via email to