From: sashiko-bot@kernel.org
To: "Pat Somaru" <patso@likewhatevs.io>
Cc: sched-ext@lists.linux.dev
Subject: Re: [PATCH] sched_ext: Add tracepoint for scheduler exit
Date: Wed, 13 May 2026 05:08:25 +0000 [thread overview]
Message-ID: <20260513050825.AC89AC2BCB7@smtp.kernel.org> (raw)
In-Reply-To: <20260512055632.1096713-1-patso@likewhatevs.io>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `sched_ext_exit` tracepoint omits the `struct scx_sched *sch` context argument, preventing BPF programs from inspecting the kernel state of the exiting scheduler.
--
commit 7146aa62d89650b7f56b6cb199c8f8b8e35dfc3a
Author: Pat Somaru <patso@likewhatevs.io>
sched_ext: Add tracepoint for scheduler exit
This commit adds a tracepoint to scx_claim_exit() to allow BPF programs
to dynamically inspect scheduler specific state when a sched_ext scheduler
exits.
> diff --git a/include/trace/events/sched_ext.h b/include/trace/events/sched_ext.h
> index d1bf5acd59c56..9ccf884919c1f 100644
> --- a/include/trace/events/sched_ext.h
> +++ b/include/trace/events/sched_ext.h
[ ... ]
> @@ -84,6 +84,25 @@ TRACE_EVENT(sched_ext_bypass_lb,
> )
> );
>
> +TRACE_EVENT(sched_ext_exit,
> +
> + TP_PROTO(__u32 kind),
> +
The commit message mentions adding this tracepoint "so that BPF programs can
dynamically inspect scheduler specific state at the moment of exit".
Will BPF programs be able to inspect the scheduler state if the tracepoint
only receives the __u32 kind argument?
BPF programs attached to tracepoints only have access to the arguments
defined in TP_PROTO. Without passing the struct scx_sched pointer, is there
a way for the BPF program to inspect the internal kernel state of the
scheduler that triggered the exit?
Also, since sched_ext supports a hierarchy of sub-schedulers, exits can be
propagated to descendants, triggering multiple concurrent sched_ext_exit
events. Without the sch context, how can the BPF program distinguish which
specific scheduler is exiting in each event?
> + TP_ARGS(kind),
> +
> + TP_STRUCT__entry(
> + __field(__u32, kind)
> + ),
[ ... ]
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index 345aa11b84b28..d38a5c7dc3927 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -5974,6 +5974,8 @@ static bool scx_claim_exit(struct scx_sched *sch, enum scx_exit_kind kind)
> */
> WRITE_ONCE(sch->aborting, true);
>
> + trace_sched_ext_exit(kind);
> +
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260512055632.1096713-1-patso@likewhatevs.io?part=1
prev parent reply other threads:[~2026-05-13 5:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 5:56 [PATCH] sched_ext: Add tracepoint for scheduler exit Pat Somaru
2026-05-12 18:08 ` Tejun Heo
2026-05-13 5:08 ` sashiko-bot [this message]
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=20260513050825.AC89AC2BCB7@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=patso@likewhatevs.io \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sched-ext@lists.linux.dev \
/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