Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jul 2007 10:58:48 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        d@delphij.net
Cc:        attilio@freebsd.org, freebsd-current@freebsd.org, Julian Elischer <julian@elischer.org>, FreeBSD Current <current@freebsd.org>
Subject:   Re: crash in tty code in 6.1.. fixed since?
Message-ID:  <200707131058.48999.hselasky@c2i.net>
In-Reply-To: <46973A08.3030607@delphij.net>
References:  <46970DF7.3000803@elischer.org> <200707131021.59966.hselasky@c2i.net> <46973A08.3030607@delphij.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 13 July 2007 10:38, LI Xin wrote:
> Hans Petter Selasky wrote:
> [...]
>
> > Maybe related:
> >
> > Regarding the keyboard system which is also Giant locked, we should add
> > assert Giant statements, because I see several callers doing calls into
> > the keyboard system without holding Giant!
>
> I think that is a good idea.  By adding these assertions our user
> community would be able to catch more under-exercised codepath under
> their workload.
>
> Do you already have some patch to add these assertions?

No. But I have added several assertions to my "ukbd.c", mainly in the 
callbacks. From time to time they trigger, and then I just return, because 
there is no other choice. That means, if you try to lock Giant, you will most 
likely get a locking order reversal.

The worst example is the mechanism when you print something and scroll lock 
led is enabled. Then printf will call the ukbd driver to clear the scroll 
lock led! Yikes. Ouuch. "ukbd.c" must out of Giant!

http://www.turbocat.net/~hselasky/isdn4bsd/sources/src/sys/dev/usb/ukbd.c

--HPS



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