All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Gabriele Monaco <gmonaco@redhat.com>
Cc: linux-kernel@vger.kernel.org, Andrea Righi <arighi@nvidia.com>,
	Joel Fernandes <joelagnelf@nvidia.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Nam Cao <namcao@linutronix.de>, Juri Lelli <jlelli@redhat.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	sched-ext@lists.linux.dev, Tomas Glozar <tglozar@redhat.com>,
	Clark Williams <williams@redhat.com>,
	John Kacur <jkacur@redhat.com>,
	linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v6 14/16] sched_ext: Export task_is_scx_enabled() for verification
Date: Thu, 26 Feb 2026 07:54:27 -1000	[thread overview]
Message-ID: <aaCI08IDGXTLvwT8@slm.duckdns.org> (raw)
In-Reply-To: <deb203ab-7564-4bef-b4bf-053c6ec08f27@redhat.com>

Hello,

On Thu, Feb 26, 2026 at 04:25:59PM +0000, Gabriele Monaco wrote:
> 2026-02-26T15:48:11Z Tejun Heo <tj@kernel.org>:
> 
> > On Thu, Feb 26, 2026 at 04:42:34PM +0100, Gabriele Monaco wrote:
> >> scx_enabled() might as well be exported (together with its static key), but I'm
> >> not sure exporting the sched_class is the right thing, since all those scheduler
> >> things are quite private.
> >
> > Don't you just need the sched_class pointer? Can't you get that from
> > kallsyms?
> 
> Yes that pointer would do. Do you mean getting it in a task_on_scx() reimplementation I would just use in RV?
> I could do that but I was looking for a more standard solution.
> While very likely the pointer to the class and the class field are here to stay, having a function like task_on_scx() directly available in include/linux/sched/ext.h is less error prone and future observability tools might need it too.
> 
> But let's rewind it a bit, if it is a big issue not to have it inlined (which probably isn't), we could just go on with something like _task_on_scx() (inlined, for the scheduler code) and task_on_scx() for other users. Wouldn't that be acceptable?

So, I don't know how rv works (searched a bit just now) but from kernel's
POV, it seems to look mostly like an additional tracing framework, and
testing p->sched_class against exported pointer value seems like a good fit
for the use case, no? It's not like task_on_scx() or state testing is going
to give you a "better" result anyway and it's actually rather confusing to
use them outside scheduler proper as these are expected to be used while the
task's rq lock is held. I don't think rv wants to (or even can) synchronize
against scheduler internals. Using external observability mechanism seems
like the better fit here.

Thanks.

-- 
tejun

  reply	other threads:[~2026-02-26 17:54 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25  9:51 [PATCH v6 00/16] rv: Add Hybrid Automata monitor type, per-object and deadline monitors Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 01/16] rv: Unify DA event handling functions across monitor types Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 02/16] rv: Add Hybrid Automata monitor type Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 03/16] verification/rvgen: Allow spaces in and events strings Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 04/16] verification/rvgen: Add support for Hybrid Automata Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 05/16] Documentation/rv: Add documentation about hybrid automata Gabriele Monaco
2026-03-02 13:58   ` Juri Lelli
2026-03-02 14:23     ` Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 06/16] rv: Add sample hybrid monitors stall Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 07/16] rv: Convert the opid monitor to a hybrid automaton Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 08/16] sched: Add task enqueue/dequeue trace points Gabriele Monaco
2026-03-06  8:58   ` Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 09/16] rv: Add enqueue/dequeue to snroc monitor Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 10/16] rv: Add support for per-object monitors in DA/HA Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 11/16] verification/rvgen: Add support for per-obj monitors Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 12/16] sched: Add deadline tracepoints Gabriele Monaco
2026-03-02 14:15   ` Juri Lelli
2026-03-02 14:24     ` Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 13/16] sched/deadline: Move some utility functions to deadline.h Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 14/16] sched_ext: Export task_is_scx_enabled() for verification Gabriele Monaco
2026-02-25 17:08   ` Tejun Heo
2026-02-26  7:10     ` Gabriele Monaco
2026-02-26 15:22       ` Tejun Heo
2026-02-26 15:42         ` Gabriele Monaco
2026-02-26 15:48           ` Tejun Heo
2026-02-26 16:25             ` Gabriele Monaco
2026-02-26 17:54               ` Tejun Heo [this message]
2026-02-26 18:39                 ` Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 15/16] rv: Add deadline monitors Gabriele Monaco
2026-03-02 14:37   ` Juri Lelli
2026-03-02 15:11     ` Gabriele Monaco
2026-02-25  9:51 ` [PATCH v6 16/16] rv: Add dl_server specific monitors Gabriele Monaco

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=aaCI08IDGXTLvwT8@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=gmonaco@redhat.com \
    --cc=jkacur@redhat.com \
    --cc=jlelli@redhat.com \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namcao@linutronix.de \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=tglozar@redhat.com \
    --cc=williams@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.