Re: Question on kdb_event

"jidong xiao" <[email protected]>
Newsgroups gmane.linux.kernel.debugging
Message-ID <[email protected]>
On Nov 3, 2007 2:34 AM, Jay Lan <[email protected]> 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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.