kbdmux vs ATA? (was: ATA related panic during ZFS scrub)

Robert Watson rwatson at FreeBSD.org
Wed Apr 8 12:38:47 PDT 2009


On Wed, 8 Apr 2009, Ed Schouten wrote:

> * Ivan Voras <ivoras at freebsd.org> wrote:
>> Hmmm, this shows a lock order problem between ATA and kbdmux's Giant.
>
> The current state of the input layer is a mess. I guess the policy was to 
> not pick up any locks while in the debugger. Picking up Giant there is one 
> of the most awful things that can happen, right?

As a general rule, the low-level console interfaces should acquire at most 
spinlocks in normal operation (cngetc, cnputc, etc), and no locks at all when 
in the debugger (kdb_active).  The reason for the second rule should be 
obvious, but the reason for the first rule is less obvious: it's called during 
the boot in all kinds of sensitive places as a result of calls to printf(9), 
so has to be willing to run under the most sticky of circumstances.

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the freebsd-current mailing list