Re: [PATCH] kernel/hung_task.c: force ignore_loglevel before panic
From: Petr Mladek
Date: Tue Dec 11 2018 - 09:46:09 EST
On Tue 2018-12-11 01:16:10, Liu, Chuansheng wrote:
> > From: Tetsuo Handa [mailto:penguin-kernel@xxxxxxxxxxxxxxxxxxx]
> > On 2018/12/10 15:11, Sergey Senozhatsky wrote:
> > > On (12/10/18 05:58), Liu, Chuansheng wrote:
> > >>> On (12/10/18 05:40), Liu, Chuansheng wrote:
> > >>>> @@ -130,6 +130,13 @@ static void check_hung_task(struct task_struct
> > - if (!sysctl_hung_task_warnings && !sysctl_hung_task_panic)
> > - return;
> > + if (sysctl_hung_task_panic) {
> > + console_verbose();
> > + hung_task_show_lock = true;
> > + hung_task_call_panic = true;
> > + }
> > (...snipped...)
> > - if (sysctl_hung_task_panic) {
> > - hung_task_show_lock = true;
> > - hung_task_call_panic = true;
> > - }
> Thanks Tetsuo, I prefer this option, which makes code more readable.
I like this variant as well. Also using console_verbose() looks
like a better choice.
> More thoughts in this condition of sysctl_hung_task_warnings == 0 && sysctl_hung_task_panic == 1,
> in this case, debug_show_all_locks() may not output useful information if LOCK DEBUG config is not enabled.
> trigger_all_cpu_backtrace() will not show the hung task for debugging either.
>
> We may enhance it by:
> - if (sysctl_hung_task_warnings) {
> + if (sysctl_hung_task_panic || sysctl_hung_task_warnings) {
> if (sysctl_hung_task_warnings > 0)
> sysctl_hung_task_warnings--;
I agree with Tetsuo that we should not touch this.
The warnings will get typically printed because panic() will get
triggered on the first occasion. And we should respect when the admin
disables the warnings completely.
Best Regards,
Petr