mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>
Cc: Wanwu Li <liwanwu@kylinos.cn>, David Vernet <void@manifault.com>,
	Changwoo Min <changwoo@igalia.com>,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched_ext: Reject NMI calls to lock-taking kfuncs
Date: Tue, 1 Sep 2026 22:28:12 +0200	[thread overview]
Message-ID: <apc1XBAIV3AWQ3jt@gpd4> (raw)
In-Reply-To: <apcx5yUysXEuEYAf@slm.duckdns.org>

On Tue, Sep 01, 2026 at 10:13:27AM -1000, Tejun Heo wrote:
> Hello,
> 
> On Tue, Sep 01, 2026 at 09:51:37PM +0200, Andrea Righi wrote:
> > AFAICS, the lock-taking and state-changing kfuncs do not have a meaningful use
> > from BPF_PROG_TYPE_TRACING. We could move them out of scx_kfunc_ids_any into a
> > separate set registered only for BPF_PROG_TYPE_STRUCT_OPS. The read-only kfuncs
> > could remain available to tracing programs.
> > 
> > This should include:
> >  - scx_bpf_kick_cpu() / scx_bpf_kick_cid()
> >  - scx_bpf_destroy_dsq()
> >  - scx_bpf_dsq_reenq() / scx_bpf_reenqueue_local___v2()
> >  - bpf_iter_scx_dsq_{new,next,destroy}()
> >  - scx_bpf_cpuperf_set() / scx_bpf_cidperf_set()
> >  - scx_bpf_sub_grant() / scx_bpf_sub_revoke()
> >  (... maybe others that I'm missing ...)
> 
> Hmm... but it *is* useful to be able to e.g. kick a CPU or trigger reenq
> from a trace event, no?

Kicking a CPU, yes - scx_pair is actually using that.

I'm less convinced about the reenq case. We used to have the famous reenq from
sched_switch use case, but now that we have ENQ_IMMED and deadline server, are
there other concrete use cases for it?

Maybe we should decide tracing visibility per kfunc rather than exposing every
"any" kfunc and adding the runtime check to all of them. But this can be
revised/improved later. In the meantime this seems to fix a real issue and the
approach looks correct, so:

Acked-by: Andrea Righi <arighi@nvidia.com>

Thanks,
-Andrea

  reply	other threads:[~2026-09-01 20:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01  9:56 Wanwu Li
2026-09-01 19:51 ` Andrea Righi
2026-09-01 20:13   ` Tejun Heo
2026-09-01 20:28     ` Andrea Righi [this message]
2026-09-01 21:16 ` Tejun Heo
2026-09-02  2:31   ` [PATCH v2] " Wanwu Li
2026-09-02  6:44     ` Tejun Heo
2026-09-02  9:36       ` [PATCH v3] " Wanwu Li
2026-09-02 23:05         ` Tejun Heo
2026-09-03  1:46           ` liwanwu
2026-09-02 13:48       ` [PATCH v2] " liwanwu
2026-09-02 21:51         ` Tejun Heo

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=apc1XBAIV3AWQ3jt@gpd4 \
    --to=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liwanwu@kylinos.cn \
    --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

all inboxes | Powered by JetHome®