Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jan 2006 19:20:46 +0100
From:      Juergen Lock <nox@jelal.kn-bremen.de>
To:        Ian Dowse <iedowse@iedowse.com>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: cvs commit: src/sys/dev/usb ehci.c ehci_pci.c ehcivar.h
Message-ID:  <20060131182045.GA47403@saturn.kn-bremen.de>
In-Reply-To: <200601310112.aa34663@nowhere.iedowse.com>
References:  <20060130223413.GA11711@saturn.kn-bremen.de> <200601310112.aa34663@nowhere.iedowse.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jan 31, 2006 at 01:12:35AM +0000, Ian Dowse wrote:
> In message <20060130223413.GA11711@saturn.kn-bremen.de>, Juergen Lock writes:
> > Alright, here comes that:
> 
> >    intr_context = 3,
> 
> Interesting - this actually suggests that two threads might be in
> the the interrupt service routine at the same time, which should
> not be possible unless there is a bug causing a callback to sleep.
> 
> Could you see if you can find the EHCI interrupt thread in the output of:
> 
> 	ps -axl -M vmcore -N kernel | grep irq
> 
> It might show up like "[irq3: ehci" but if there are other interrupts
> shared with it you might need to look through dmesg output to find the
> IRQ number used by ehci and then look for that thread instead.

Had to look at dmesg, ehci is sharing irq 11 with the promise sata
card and the symbios scsi card.
> 
> Then from gdb, use 'info threads' to find the gdb thread ID for it
> (look for the PID=XX then read the first column). Finally, "thread
> TID" followed by "bt" should show what that thread is doing. e.g.
> if you see
> 
>   7 Thread 100002 (PID=14: irq3: ehci0)  0xc050bb23 in ...
> 
> then use "thread 7" and "bt".

 Alright, looks like it was paging: (usb_block_allocmem ending up
calling contigmalloc...  which makes me wonder what would happen
there if someone had swap on a umass device?  swap here is on
ad4s2b which is on the sata card.)

bash 10.3# kgdb kernel.debug /var/crash/vmcore.10
[GDB will not be able to debug user-mode threads: /usr/lib/libthread_db.so: Undefined symbol "ps_pglobal_lookup"]
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd".
#0  doadump () at pcpu.h:159
159		__asm __volatile("movl %%fs:0,%0" : "=r" (td));
(kgdb) info threads 
...
  151 PID    22 TID 100016 (irq11: atapci0 sym*)  0xc05f239b in sched_switch (
    td=0xc1983900, newtd=0xc1987180, flags=1)
    at /usr/home/nox/src54/usr/src/sys/kern/sched_4bsd.c:881
...
(kgdb) thread 151
[Switching to thread 151 (PID    22 TID 100016)]#0  0xc05f239b in sched_switch
    (td=0xc1983900, newtd=0xc1987180, flags=1)
    at /usr/home/nox/src54/usr/src/sys/kern/sched_4bsd.c:881
881			cpu_switch(td, newtd);
(kgdb) bt
#0  0xc05f239b in sched_switch (td=0xc1983900, newtd=0xc1987180, flags=1)
    at /usr/home/nox/src54/usr/src/sys/kern/sched_4bsd.c:881
#1  0xc05e8eaa in mi_switch (flags=1, newtd=0x0)
    at /usr/home/nox/src54/usr/src/sys/kern/kern_synch.c:355
#2  0xc05fecaa in sleepq_switch (wchan=0x0)
    at /usr/home/nox/src54/usr/src/sys/kern/subr_sleepqueue.c:406
#3  0xc05fee93 in sleepq_wait (wchan=0xcbe86030)
    at /usr/home/nox/src54/usr/src/sys/kern/subr_sleepqueue.c:518
#4  0xc05e8bea in msleep (ident=0xcbe86030, mtx=0xc08a6a40, priority=68, 
    wmesg=0xc07e8c8e "swwrt", timo=0)
    at /usr/home/nox/src54/usr/src/sys/kern/kern_synch.c:228
#5  0xc0629267 in bwait (bp=0xcbe86030, pri=68 'D', wchan=0xc07e8c8e "swwrt")
    at /usr/home/nox/src54/usr/src/sys/kern/vfs_bio.c:3763
#6  0xc0727b15 in swap_pager_putpages (object=0xc25bfce4, m=0xd41fdaa4, 
    count=1, sync=1, rtvals=0xd41fda70)
    at /usr/home/nox/src54/usr/src/sys/vm/swap_pager.c:1365
#7  0xc0725840 in default_pager_putpages (object=0xc25bfce4, m=0xd41fdaa4, 
    c=1, sync=1, rtvals=0xd41fda70)
    at /usr/home/nox/src54/usr/src/sys/vm/default_pager.c:132
#8  0xc0739743 in vm_pageout_flush (mc=0xd41fdaa4, count=1, flags=1)
    at vm_pager.h:147
#9  0xc073809e in vm_contig_launder_page (m=0xc18fee00)
    at /usr/home/nox/src54/usr/src/sys/vm/vm_contig.c:121
---Type <return> to continue, or q <return> to quit---
#10 0xc0738b6e in vm_page_alloc_contig (npages=16, low=0, high=4294967295, 
    alignment=1, boundary=0)
    at /usr/home/nox/src54/usr/src/sys/vm/vm_contig.c:451
#11 0xc0738ef7 in contigmalloc (size=65536, type=0xc0829c40, flags=1, low=0, 
    high=4294967295, alignment=1, boundary=0)
    at /usr/home/nox/src54/usr/src/sys/vm/vm_contig.c:555
#12 0xc0760194 in bus_dmamem_alloc (dmat=0xc2d0f400, vaddr=0xc2a24cc8, 
    flags=0, mapp=0x0)
    at /usr/home/nox/src54/usr/src/sys/i386/i386/busdma_machdep.c:504
#13 0xc0582a63 in usb_block_allocmem (tag=0x0, size=65536, align=1, 
    dmap=0xc297a63c) at /usr/home/nox/src54/usr/src/sys/dev/usb/usb_mem.c:187
#14 0xc0582b40 in usb_allocmem (bus=0x0, size=65536, align=0, p=0xc297a63c)
    at /usr/home/nox/src54/usr/src/sys/dev/usb/usb_mem.c:248
#15 0xc056e03b in ehci_allocm (bus=0xc1a3f800, dma=0xc297a63c, size=64512)
    at /usr/home/nox/src54/usr/src/sys/dev/usb/ehci.c:1149
#16 0xc0584885 in usbd_transfer (xfer=0xc297a600)
    at /usr/home/nox/src54/usr/src/sys/dev/usb/usbdi.c:311
#17 0xc057e545 in umass_setup_transfer (sc=0x0, pipe=0xc29a6b80, 
    buffer=0xd16bd028, buflen=64512, flags=0, xfer=0xc297a600)
    at /usr/home/nox/src54/usr/src/sys/dev/usb/umass.c:1204
#18 0xc057e8ca in umass_bbb_state (xfer=0xc1aaf300, priv=0xc1c22e00, 
    err=USBD_NORMAL_COMPLETION)
    at /usr/home/nox/src54/usr/src/sys/dev/usb/umass.c:1491
---Type <return> to continue, or q <return> to quit---
#19 0xc0584fd8 in usb_transfer_complete (xfer=0xc1aaf300)
    at /usr/home/nox/src54/usr/src/sys/dev/usb/usbdi.c:851
#20 0xc056d9b0 in ehci_idone (ex=0xc1aaf300)
    at /usr/home/nox/src54/usr/src/sys/dev/usb/ehci.c:877
#21 0xc056d887 in ehci_check_intr (sc=0xc1a3f800, ex=0xc1aaf300)
    at /usr/home/nox/src54/usr/src/sys/dev/usb/ehci.c:762
#22 0xc056d7bd in ehci_softintr (v=0xc1a3f800)
    at /usr/home/nox/src54/usr/src/sys/dev/usb/ehci.c:696
#23 0xc0582281 in usb_schedsoftintr (bus=0x0)
    at /usr/home/nox/src54/usr/src/sys/dev/usb/usb.c:870
#24 0xc056d59e in ehci_intr1 (sc=0xc1a3f800)
    at /usr/home/nox/src54/usr/src/sys/dev/usb/ehci.c:596
#25 0xc056d4de in ehci_intr (v=0xc1a3f800)
    at /usr/home/nox/src54/usr/src/sys/dev/usb/ehci.c:555
#26 0xc05ceac5 in ithread_loop (arg=0xc197d780)
    at /usr/home/nox/src54/usr/src/sys/kern/kern_intr.c:547
#27 0xc05cdd58 in fork_exit (callout=0xc05ce974 <ithread_loop>, 
    arg=0xc197d780, frame=0xd41fdd48)
    at /usr/home/nox/src54/usr/src/sys/kern/kern_fork.c:791
#28 0xc076417c in fork_trampoline ()
    at /usr/home/nox/src54/usr/src/sys/i386/i386/exception.s:209
(kgdb) q



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060131182045.GA47403>