[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aCuPdY2fbOIOoKx6@slm.duckdns.org>
Date: Mon, 19 May 2025 10:07:17 -1000
From: Tejun Heo <tj@...nel.org>
To: Muchun Song <muchun.song@...ux.dev>
Cc: Muchun Song <songmuchun@...edance.com>, jiangshanlai@...il.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] workqueue: show the latest function name in
/proc/PID/{comm,stat,status}
Hello,
On Fri, May 16, 2025 at 12:44:19PM +0800, Muchun Song wrote:
...
> Monitoring tools like atop can indeed record comm of processes. When we
> encounter issues such as high CPU usage, these tools can help us identify
> the problem. For instance, if kworkers are consuming most of the CPU, we
> can use this information to pinpoint which specific function is using
> the most CPU.
You can get more detailed information with `cat /proc/KWORKER_PID/stack`.
The problem is that last_func can be stale most of the time and can be more
misleading than useful.
> Another use case is when we use the isolcpus= command line option
> to isolate CPUs, we want to make sure that no kworker threads run on
> those CPUs. But sometimes, kworkers might still get scheduled there, causing latency
> issues. By using this information, we can figure out which module's
> function ran on the CPU before and then dig into the code to see how to
> stop it from happening.
Can you explain why `cat /proc/KWORKER_PID/stack` can't be used for that? If
the worker runtime is too short to capture, you can easily use tracepoints
or bpftrace too. What are the benefits of showing last_func?
Thanks.
--
tejun
Powered by blists - more mailing lists