public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>
Cc: Changwoo Min <changwoo@igalia.com>,
	void@manifault.com, kernel-dev@igalia.com,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] sched_ext: Dump the stall CPU first in watchdog exit
Date: Thu, 9 Apr 2026 07:52:23 +0200	[thread overview]
Message-ID: <adc-l_7ZNWLkyPFL@gpd4> (raw)
In-Reply-To: <adb-pduIY6oZxLYh@slm.duckdns.org>

On Wed, Apr 08, 2026 at 03:19:33PM -1000, Tejun Heo wrote:
> On Wed, Apr 08, 2026 at 12:11:13PM +0900, Changwoo Min wrote:
> > When a watchdog timeout fires, the CPU where the stalled task was
> > running is the most relevant piece of information for diagnosing the
> > hang. However, if there are many CPUs, the dump can get truncated and
> > the stall CPU's information may not appear in the output.
> > 
> > Add a stall_cpu field to scx_exit_info, thread it through scx_vexit()
> > and __scx_exit(), and populate it from cpu_of(rq) in
> > check_rq_for_timeouts(). In scx_dump_state(), dump the stall CPU
> > before iterating the rest so it always appears at the top of the output.
> > 
> > Introduce a scx_exit() macro that wraps __scx_exit() with stall_cpu=0
> > for all non-stall exit paths, keeping call sites unchanged.
> 
> Would it make sense to generalize this so that the exit record the CPU the
> exit is triggered on and always dump that CPU first? That should include
> stall case, is likely useful for different cases too and we don't have to
> add @stall_cpu to the exit functions.

But if we record the current CPU the exit is triggered on, in
check_rq_for_timeouts() we would prioritize the watchdog worker's CPU instead of
the stalled one, right?

Thanks,
-Andrea

  reply	other threads:[~2026-04-09  5:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08  3:11 [PATCH 0/2] sched_ext: Improve watchdog stall diagnostics Changwoo Min
2026-04-08  3:11 ` [PATCH 1/2] sched_ext: Extract scx_dump_cpu() from scx_dump_state() Changwoo Min
2026-04-08  3:11 ` [PATCH 2/2] sched_ext: Dump the stall CPU first in watchdog exit Changwoo Min
2026-04-09  1:19   ` Tejun Heo
2026-04-09  5:52     ` Andrea Righi [this message]
2026-04-09  6:28       ` Tejun Heo
2026-04-09  5:44   ` Andrea Righi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adc-l_7ZNWLkyPFL@gpd4 \
    --to=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=kernel-dev@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=tj@kernel.org \
    --cc=void@manifault.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox