[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fdef508e-1afc-3b05-76a8-3c2dfc4084f3@i-love.sakura.ne.jp>
Date: Sat, 15 May 2021 17:33:50 +0900
From: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
To: zhouchuangao <zhouchuangao@...o.com>,
Dmitry Vyukov <dvyukov@...gle.com>
Cc: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
"Guilherme G. Piccoli" <gpiccoli@...onical.com>,
Michal Hocko <mhocko@...e.com>,
Lukas Bulwahn <lukas.bulwahn@...il.com>,
Vlastimil Babka <vbabka@...e.cz>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kernel/hung_task: Report top CPU consumers
On 2021/05/14 21:56, zhouchuangao wrote:
> 1. If the task did not get scheduled for more than 2 minutes,
> report top 3(By default) CPU consumers.
>
> 2. By default, the CPU utilization of each process in one minute
> is calculated.
+ all_cpu_usage(false);
+ show_top_cpu_consumers(false);
+ msleep(1000);
+ all_cpu_usage(true);
+ show_top_cpu_consumers(true);
1 second than 1 minute? Too short to determine top CPU consumers?
>
> 3. Add a new member last_cpu_time to task_struct to record the CPU
> usage of the process at the beginning of the computation.
Speak of syzbot testing, in many cases the cause of hung task is simply
somebody else was consuming too much CPU resources. Therefore, without
backtraces of top CPU consumer processes, I think it is not different from
calling
call_usermodehelper("/bin/sh", { "sh", "-c", "exec top -b -d 1 -n 1 > /dev/klog", NULL }, { NULL }, UMH_WAIT_PROC | UMH_KILLABLE);
before panic().
Maybe a hook for executing some userspace commands with some timeout before panic() is more useful?
Powered by blists - more mailing lists