kdb
[Top] [All Lists]

Re: Question on kdb_event

To: "Jay Lan" <jlan@xxxxxxx>
Subject: Re: Question on kdb_event
From: "jidong xiao" <jidong.xiao@xxxxxxxxx>
Date: Mon, 5 Nov 2007 13:21:50 +0800
Cc: kdb@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=oGObvBh62PbDtd9jzyx0glPdin7S2P+2h2CJfHUCgQ4=; b=WjRIgMBtlnTkDugY2NTr9eheGuahep7k0e/4VQUTjM7GT4Tb02QOHgBSs9YQNLFhM/SIJ3j+b3YKDYmT5AcUm73L0BYZudzx9f4dRGIKxh/7bvkyYOQ9IxQJHDmT+0RmHG6wDWUo/EWVCBxF6qCxW65Or+dpjRePrlrMFuxETPw=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Nj6z6zmSa2RyPbJeRw2nLglentBc3a8UdMLnBfjzua9j/+VlUdZYgHByhFBce9IPJ6nbYEYWYYpwtGzIIFuEhzoh7J/5r+xI69ucYsPwNxA9ceXEO71jpHVhr4L+nk8Sc74X3zG6WF2cbNeUjqCZ1zD657hHso9sd67T7mYUz9s=
In-reply-to: <472B6DB1.5080904@xxxxxxx>
References: <4104961b0710310358y58bc0e1bm797fe236c8feb409@xxxxxxxxxxxxxx> <472B6DB1.5080904@xxxxxxx>
Sender: kdb-bounce@xxxxxxxxxxx
On Nov 3, 2007 2:34 AM, Jay Lan <jlan@xxxxxxx> wrote:
>
> jidong xiao wrote:
> > Hi,all
> >
> > Can anyone kindly explain the usage of kdb_event?Thank you very much!
> > I saw this varible is used only in two places, inside kdb_printf() and
> > kdb(), kdb_event is incremented and decremented. But I have no idea
> > why do we need to use it in these two circumstance.
>
> KDB modifies <linux/console.h> in this way:
> #ifdef  CONFIG_KDB
> #include <linux/kdb.h>
> #define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() &&
> !oops_in_progress && !atomic_read(&kdb_event))
> #else   /* !CONFIG_KDB */
> #define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() &&
> !oops_in_progress)
> #endif  /* CONFIG_KDB */
>
> The counter of kdb_event affects the value of WARN_CONSOLE_UNLOCKED().
>
> Thanks,
>  - jay
>
Well yes I saw kdb modifies WARN_CONSOLE_UNLOCKED, and I can
understand the reason that kdb_event is incremented/decremented in
kdb_printf(),  because kdb_printf() will finally invoke
vt_console_print()->hide_cursor()->clear_selection()->highlight_pointer()->complement_pos(),
inside complement_pos(), WARN_CONSOLE_UNLOCKED is called. so in
kdb_printf() we should increment kdb_event to avoid the warning
message,or in other words, to avoid deadlock.

But what I can't understand is that why we increment kdb_event at the
begining of kdb()?Is it neccessary?

Thanks
Jason
---------------------------
Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.
<Prev in Thread] Current Thread [Next in Thread>