From owner-freebsd-arch@FreeBSD.ORG Mon Aug 29 14:02:15 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF1CE106566C; Mon, 29 Aug 2011 14:02:15 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe05.c2i.net [212.247.154.130]) by mx1.freebsd.org (Postfix) with ESMTP id 154228FC17; Mon, 29 Aug 2011 14:02:14 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=npWEf5XEtLL8qLh8yAfHNcIa2ktE1/5Qf1/k+5E0ZhU= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=ni9ZY7ZFbhgA:10 a=WQU8e4WWZSUA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8 a=N3vH5299AAAA:8 a=NgtFCEsrzr7jmxhDPogA:9 a=_25ACjrlY3KuqGwTwWsA:7 a=wPNLvfGTeEIA:10 a=Zv46p6KrLxFnKoET:21 a=HVLLaQIwngGYuGGz:21 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 170228985; Mon, 29 Aug 2011 16:02:12 +0200 From: Hans Petter Selasky To: freebsd-arch@freebsd.org Date: Mon, 29 Aug 2011 15:59:39 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <4E53986B.5000804@FreeBSD.org> <201108251352.31504.hselasky@c2i.net> <4E5B91E0.6090305@FreeBSD.org> In-Reply-To: <4E5B91E0.6090305@FreeBSD.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201108291559.39440.hselasky@c2i.net> Cc: Andriy Gapon Subject: Re: skipping locks, mutex_owned, usb X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2011 14:02:15 -0000 On Monday 29 August 2011 15:19:28 Andriy Gapon wrote: > on 25/08/2011 14:52 Hans Petter Selasky said the following: > >> http://people.freebsd.org/~avg/stop_scheduler_on_panic.diff > >> http://people.freebsd.org/~avg/stop_scheduler_on_panic.8.x.diff > > > > The following patch complements Andriy's patch with regard to USB. Please > > test and report back! > > > > http://hselasky.homeunix.org:8192/usb_scheduler_stopped.patch > > Here is my take on the issue: > http://people.freebsd.org/~avg/ukbd-polling.diff > Admittedly it has a few hairy places, but overall it should reduce the > number of lines and quirks in the ukbd code. > The patch can be logically separated into three parts: > - locking Giant around kbdd_poll and scgetc calls in sc_cngetc > - SCHEDULER_STOPPED-vs-mutex_owned changes in usb_transfer.c > - removing explicit Giant checks and manipulations in ukbd.c > Hi, > I would like to ask for a review of these changes in whole or in parts. > Thank you! I am bit worried by all the mtx_lock(&Giant) removal, though if it passes the following tests, it should be OK. The non-ukbd USB part looks fine! Compile a kernel with WITNESS and INVARIANTS options. Test cases: T1) NON-X11 login console: Press SCROLL LOCK. Press PAGE UP to scroll history. Type something or plug another USB device. Does SCROLL lock clear seamlessly when other text is printed on the console? T2) Switching between X11 and text console using ALT+CTRL+FX. Make sure no mutex related errors appear even when pressing keys/SCROLLOCK/NUMLOCK during the switchover. T3) Typing text at mount-root prompt should work without any keys lost. T4) Typing text in KDB should work. T5) Typing text after dump should work when scheduler is stopped. T6) Toggle Num-lock both in X11 and non-X11. > > Further, I think that ideally we should follow bde's suggestion of > extending syscons interface to allow explicitly going into and out of the > polling mode instead of implicitly doing that for every character. > Also, perhaps kernel doesn't always have to use the polling mode - for > example I think that the mountroot prompt should do fine in the regular > mode. Right. --HPS