From owner-freebsd-usb@FreeBSD.ORG Wed Dec 14 15:37:58 2011 Return-Path: Delivered-To: usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0589E106564A; Wed, 14 Dec 2011 15:37:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id AD5558FC08; Wed, 14 Dec 2011 15:37:56 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA08219; Wed, 14 Dec 2011 17:37:50 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <4EE8C2CE.40909@FreeBSD.org> Date: Wed, 14 Dec 2011 17:37:50 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111109 Thunderbird/8.0 MIME-Version: 1.0 To: Hans Petter Selasky References: <4EE51CB5.1060505@FreeBSD.org> <201112121658.22864.hselasky@c2i.net> <201112121405.38322.jhb@freebsd.org> <201112122009.12557.hselasky@c2i.net> <4EE67E4F.3010906@FreeBSD.org> <4EE70A1F.8040406@FreeBSD.org> In-Reply-To: <4EE70A1F.8040406@FreeBSD.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: usb@FreeBSD.org, freebsd-hackers@FreeBSD.org, John Baldwin , mdf@FreeBSD.org Subject: Re: kern_yield vs ukbd_yield X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Dec 2011 15:37:58 -0000 on 13/12/2011 10:17 Andriy Gapon said the following: > on 13/12/2011 00:21 Andriy Gapon said the following: [snip] > And in the view of the below data I would like us to revisit this problem. > I looked over usb code and it seems that all usb threads are created with > priorities of either USB_PRI_MED or USB_PRI_HIGH, which translates to > PI_SWI(SWI_CAMBIO) and PI_SWI(SWI_NET). These priorities should be in the > ithread range, so it's kind of surprising that the init thread (with PVM > priority) can cause troubles for them. So, Hans Petter, do you recall any details of this problem? I am curious about which thread got starved by which. BTW, given your recent improvements to pause(9) what do you think about further extending it to also use DELAY(9) when kdb_active is set or when SCHEDULER_STOPPED() is true? Then, probably, pause(9) could be used for both branches in ukbd_do_poll and they could be collapsed together. >> Breakpoint 1, ukbd_do_poll (sc=0xffffff8000764000, wait=0 '\0') at >> /usr/src/sys/dev/usb/input/ukbd.c:403 >> 403 { >> (kgdb) bt >> #0 ukbd_do_poll (sc=0xffffff8000764000, wait=0 '\0') at >> /usr/src/sys/dev/usb/input/ukbd.c:403 >> #1 0xffffffff803ee57e in ukbd_check (kbd=Variable "kbd" is not available. >> ) at /usr/src/sys/dev/usb/input/ukbd.c:1418 >> #2 0xffffffff803ee674 in ukbd_check_char (kbd=0xffffff8000764000) at >> /usr/src/sys/dev/usb/input/ukbd.c:1450 >> #3 0xffffffff8035c794 in kbdmux_read_char (kbd=0xfffffe00021d2c00, >> wait=Variable "wait" is not available. >> ) at /usr/src/sys/dev/kbdmux/kbdmux.c:665 >> #4 0xffffffff803bf4aa in scgetc (sc=0xffffffff81835dc0, flags=Variable "flags" >> is not available. >> ) at /usr/src/sys/dev/syscons/syscons.c:3373 >> #5 0xffffffff803c2d03 in sc_cngetc (cd=Variable "cd" is not available. >> ) at /usr/src/sys/dev/syscons/syscons.c:1753 >> #6 0xffffffff804ae489 in cncheckc () at /usr/src/sys/kern/kern_cons.c:402 >> #7 0xffffffff804ae4c7 in cngetc () at /usr/src/sys/kern/kern_cons.c:383 >> #8 0xffffffff804ae9a7 in cngets (cp=0xffffff8000326aa0 "", size=80, visible=1) >> at /usr/src/sys/kern/kern_cons.c:421 >> #9 0xffffffff80594d4e in vfs_mountroot () at /usr/src/sys/kern/vfs_mountroot.c:490 >> #10 0xffffffff804a6e65 in start_init (dummy=Variable "dummy" is not available. >> ) at /usr/src/sys/kern/init_main.c:683 >> #11 0xffffffff804c5a9a in fork_exit (callout=0xffffffff804a6e00 , >> arg=0x0, frame=0xffffff8000326c50) at /usr/src/sys/kern/kern_fork.c:995 >> #12 0xffffffff806bb72e in fork_trampoline () at >> /usr/src/sys/amd64/amd64/exception.S:602 >> #13 0x0000000000000000 in ?? () >> (kgdb) p td->td_proc->p_pid >> $7 = 1 >> (kgdb) p td->td_proc->p_comm >> $8 = "kernel", '\0' >> (kgdb) p td->td_tid >> $9 = 100002 >> >> Also: >> (kgdb) p/d td->td_user_pri >> $10 = 139 >> (kgdb) p/d td->td_base_pri >> $11 = 84 >> > > -- Andriy Gapon