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

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Wed, 8 Apr 2009 20:38:44 +0100 (BST)
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
Received on Wed Apr 08 2009 - 17:38:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:45 UTC