From owner-freebsd-current@FreeBSD.ORG Fri Dec 16 20:53:02 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CEE2C16A41F; Fri, 16 Dec 2005 20:53:02 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF83343D60; Fri, 16 Dec 2005 20:53:01 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.13.4/8.13.4) with ESMTP id jBGKr045021666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Dec 2005 15:53:00 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id jBGKqqFb036241; Fri, 16 Dec 2005 15:52:52 -0500 (EST) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17315.10532.603357.165238@grasshopper.cs.duke.edu> Date: Fri, 16 Dec 2005 15:52:52 -0500 (EST) To: John Baldwin In-Reply-To: <200512161454.22232.jhb@freebsd.org> References: <17314.60552.595375.783753@grasshopper.cs.duke.edu> <200512161454.22232.jhb@freebsd.org> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Cc: freebsd-current@freebsd.org Subject: Re: PREEMPTION vs ndisulator X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2005 20:53:03 -0000 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: mem > > 0xfc000000-0xfcffffff,0xfdf00000-0xfdffffff irq 18 at device 0.0 on pci5 > > ndis0: NDIS API version: 5.1 > > > > > > 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>