Re: PREEMPTION vs ndisulator

From: Andrew Gallatin <gallatin_at_cs.duke.edu>
Date: Fri, 16 Dec 2005 15:52:52 -0500 (EST)
John Baldwin writes:
 > On Friday 16 December 2005 11:34 am, Andrew Gallatin wrote:
 > > I'm trying to use an ndis driver on an amd64 machine running
 > > FreeBSD/amd64 -current from yesterday.  If I enable PREEMPTION, the
 > > machine hangs when loading the driver (kldload never returns):
 > >
 > > ndis0: <Myricom Myri-10G Ethernet Adapter> mem
 > > 0xfc000000-0xfcffffff,0xfdf00000-0xfdffffff irq 18 at device 0.0 on pci5
 > > ndis0: NDIS API version: 5.1
 > > <hang>
 > >
 > > Witness detects no problems, and if I disable PREEMPTION, the driver
 > > seems to work fine.  Is PREEMPTION not safe to be used with the
 > > ndisulator, or is there a problem with the ndis driver itself?
 > >
 > > I've included some very brief debugging info below..
 > 
 > Looks like an ithread has preempted your driver's start routine.  If you let 
 > it run some more and then break into ddb is the same thread (pid 11) still 
 > running?  Also, which process is pid 11?

Naturally, I no longer have that kernel :(

I just built a new, PREEMPTION enabled kernel.  Booting in
single user,  I see a hang in the irq thread.  It seems to
always be in this thread.

I think the difference is that I don't have the if_sk driver loaded,
which shares that irq.

Can you remind me how to get irq counts from ddb?  It 
would be intersting to see if the irq hander was called
repeatedly, or if it was just stuck in the handler.

BTW, when it works, I can send at nearly 7Gb/s.  Not bad
for an amd3000+ running an emulated driver.  Solaris/linux
can do a native 9.5Gb/sec on this hardware.  I'll do
a native FreeBSD driver when I get a chance to come up
for air ;)

Thanks,

Drew


db> ps
  pid   proc     uid  ppid  pgrp  flag   stat  wmesg    wchan  cmd
   55 ffffff001e64ea80    0     0     0 0000204 [CPU 0] irq18: ndis0
   54 ffffff001898b000    0     0     0 0000204 [SLPQ KeWFS 0xffffffff9670cb80][SLP] Windows Workitem 3
   53 ffffff001898b380    0     0     0 0000204 [SLPQ KeWFS 0xffffffff96703b80][SLP] Windows Workitem 2
   52 ffffff001898b700    0     0     0 0000204 [SLPQ KeWFS 0xffffffff966fab80][SLP] Windows Workitem 1
   51 ffffff001898ba80    0     0     0 0000204 [SLPQ KeWFS 0xffffffff966f1b80][SLP] Windows Workitem 0
   50 ffffff00189cc000    0     0     0 0000204 [RUNQ] Windows DPC 0
   49 ffffff00189cc380    0    45    49 0004002 [RUNQ] kldload
   45 ffffff001ecc6a80    0    43    45 0004002 [SLPQ pause 0xffffff001ecc6ae8][SLP] tcsh
   43 ffffff001e989380    0     1    43 0004002 [SLPQ wait 0xffffff001e989380][SLP] sh
   42 ffffff001e989700    0     0     0 0000204 [SLPQ - 0xffffffff95119c24][SLP] schedcpu
   41 ffffff001e989a80    0     0     0 0000204 [SLPQ - 0xffffffff80662918][SLP] nfsiod 3
   40 ffffff001e98a000    0     0     0 0000204 [SLPQ - 0xffffffff80662910][SLP] nfsiod 2
   39 ffffff001e98a380    0     0     0 0000204 [SLPQ - 0xffffffff80662908][SLP] nfsiod 1
   38 ffffff001e98a700    0     0     0 0000204 [SLPQ - 0xffffffff80662900][SLP] nfsiod 0
   37 ffffff001e98aa80    0     0     0 0000204 [SLPQ syncer 0xffffffff805d9500][SLP] syncer
   36 ffffff001e64e000    0     0     0 0000204 [SLPQ vlruwt 0xffffff001e64e000][SLP] vnlru
   35 ffffff001ed0d700    0     0     0 0000204 [SLPQ psleep 0xffffffff8065d818][SLP] bufdaemon
   34 ffffff001ed0da80    0     0     0 000020c [SLPQ pgzero 0xffffffff8066a9f0][SLP] pagezero
   33 ffffff001ec65000    0     0     0 0000204 [SLPQ psleep 0xffffffff8066a0d4][SLP] vmdaemon
--More--^M        ^M   32 ffffff001ec65380    0     0     0 0000204 [SLPQ psleep 0xffffffff8066a08c][SLP] pagedae
mon
   31 ffffff001ec65700    0     0     0 0000204 [IWAIT] swi0: sio
   30 ffffff001ec65a80    0     0     0 0000204 [SLPQ cooling 0xffffff001ec9f958][SLP] acpi_cooling0
   29 ffffff001ecc6000    0     0     0 0000204 [SLPQ tzpoll 0xffffffff805d2488][SLP] acpi_thermal
   28 ffffff001ecc6380    0     0     0 0000204 [IWAIT] irq17: fwohci0
   27 ffffff001ecc6700    0     0     0 0000204 [IWAIT] irq23: atapci1
   26 ffffff001ed36700    0     0     0 0000204 [IWAIT] irq15: ata1
   25 ffffff001ed36a80    0     0     0 0000204 [IWAIT] irq14: ata0
   24 ffffff001ed2c000    0     0     0 0000204 [SLPQ usbevt 0xffffff0000917420][SLP] usb1
   23 ffffff001ed2c380    0     0     0 0000204 [IWAIT] irq22: nve0 ehci0
   22 ffffff001ed2c700    0     0     0 0000204 [SLPQ usbtsk 0xffffffff805d4d90][SLP] usbtask
   21 ffffff001ed2ca80    0     0     0 0000204 [SLPQ usbevt 0xffffffff83ce9420][SLP] usb0
   20 ffffff001ed0d000    0     0     0 0000204 [IWAIT] irq21: ohci0+
   19 ffffff001ed0d380    0     0     0 0000204 [IWAIT] irq9: acpi0
    9 ffffff001ecf9a80    0     0     0 0000204 [SLPQ - 0xffffff00008f0c00][SLP] thread taskq
   18 ffffff001ed12000    0     0     0 0000204 [IWAIT] swi5: Fast taskq
    8 ffffff001ed12380    0     0     0 0000204 [SLPQ - 0xffffff00008f0d80][SLP] acpi_task2
    7 ffffff001ed12700    0     0     0 0000204 [SLPQ - 0xffffff00008f0d80][SLP] acpi_task1
    6 ffffff001ed12a80    0     0     0 0000204 [SLPQ - 0xffffff00008f0d80][SLP] acpi_task0
    5 ffffff001ed36000    0     0     0 0000204 [SLPQ - 0xffffff00008f0e00][SLP] kqueue taskq
--More--^M        ^M   17 ffffff001ed36380    0     0     0 0000204 [IWAIT] swi2: cambio
   16 ffffff001ed32380    0     0     0 0000204 [IWAIT] swi6: task queue
   15 ffffff001ed32700    0     0     0 0000204 [IWAIT] swi6: Giant taskq
   14 ffffff001ed32a80    0     0     0 0000204 [SLPQ - 0xffffffff805d2c80][SLP] yarrow
    4 ffffff001ecf9000    0     0     0 0000204 [SLPQ - 0xffffffff805d5938][SLP] g_down
    3 ffffff001ecf9380    0     0     0 0000204 [SLPQ - 0xffffffff805d5930][SLP] g_up
    2 ffffff001ecf9700    0     0     0 0000204 [SLPQ - 0xffffffff805d5920][SLP] g_event
   13 ffffff001ed48000    0     0     0 0000204 [IWAIT] swi3: vm
   12 ffffff001ed48380    0     0     0 000020c [RUNQ] swi4: clock sio
   11 ffffff001ed48700    0     0     0 0000204 [IWAIT] swi1: net
   10 ffffff001ed48a80    0     0     0 000020c [Can run] idle
    1 ffffff001ed32000    0     0     1 0004200 [SLPQ wait 0xffffff001ed32000][SLP] init
    0 ffffffff805d5aa0    0     0     0 0000200 [IWAIT] swapper
db> trace
Tracing pid 55 tid 100047 td 0xffffff001e890000
kdb_enter() at kdb_enter+0x2f
siointr1() at siointr1+0x400
siointr() at siointr+0x2e
intr_execute_handlers() at intr_execute_handlers+0x124
lapic_handle_intr() at lapic_handle_intr+0x21
Xapic_isr1() at Xapic_isr1+0x7c
--- interrupt, rip = 0xffffffff803c17e2, rsp = 0xffffffff953c0bf0, rbp = 0xffffffff953c0c10 ---
spinlock_exit() at spinlock_exit+0x32
ithread_loop() at ithread_loop+0x30d
fork_exit() at fork_exit+0xbb
fork_trampoline() at fork_trampoline+0xe
--- trap 0, rip = 0, rsp = 0xffffffff953c0d40, rbp = 0 ---
db> 
Received on Fri Dec 16 2005 - 19:53:02 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:49 UTC