Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Aug 2011 15:59:39 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-arch@freebsd.org
Cc:        Andriy Gapon <avg@freebsd.org>
Subject:   Re: skipping locks, mutex_owned, usb
Message-ID:  <201108291559.39440.hselasky@c2i.net>
In-Reply-To: <4E5B91E0.6090305@FreeBSD.org>
References:  <4E53986B.5000804@FreeBSD.org> <201108251352.31504.hselasky@c2i.net> <4E5B91E0.6090305@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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