All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Andrea Righi <arighi@nvidia.com>
Cc: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>,
	Changwoo Min <changwoo@igalia.com>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	David Dai <david.dai@linux.dev>,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH sched_ext/for-7.3-fixes] sched_ext: Pass the initial cmask to cid-form ops.enable()
Date: Fri, 18 Sep 2026 14:28:54 -1000	[thread overview]
Message-ID: <6e56532df8297554f3f76ad8748e84c9@kernel.org> (raw)
In-Reply-To: <aq2vjD_eTI3sMK91@gpd4>

Hello,

On Fri, Sep 18, 2026 at 11:39:24PM +0200, Andrea Righi wrote:
> Can we deliver the initial ops.set_cmask() before ops.set_weight()? Otherwise
> set_weight() can observe an empty or stale saved mask during the initial enable.
> This can matter if ops.set_weight() derives per-domain state from both the
> task's weight and its allowed cids.

Yeah, makes sense. Moved ahead of set_weight() in v3.

> Does this break existing cid-form scheduler that implements ops.enable()?
> If an existent scheduler moves the new prototype, does it load both with old and
> new kernels? In theory if the new args isn't used, LLVM should eliminate it, so
> existent BPF schedulers just need to use the new prototype and should be fine,
> but I haven't tested it.

The cid form is still considered unreleased, so compat isn't a concern there
yet and breaking an existing enable() is fine at this point. FWIW, I did test
it: a two-argument enable() that doesn't touch @args never reads the second
ctx slot and loads on the old kernel, one that reads it is rejected there
("func 'enable' doesn't have 3-th argument"), and an old one-argument
enable() loads fine on the new kernel.

> Can we also add a small selftest comparing the mask received by enable() with
> the immediately following set_cmask()? That would cover arena-pointer rebasing,
> mask contents, and callback ordering.

Added in v3.

Thanks.

--
tejun

      reply	other threads:[~2026-09-19  0:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 20:58 [PATCH sched_ext/for-7.3-fixes] sched_ext: Pass the initial cmask to cid-form ops.enable() Tejun Heo
2026-09-18 21:10 ` sashiko-bot
2026-09-18 21:39 ` Andrea Righi
2026-09-19  0:28   ` Tejun Heo [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=6e56532df8297554f3f76ad8748e84c9@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=david.dai@linux.dev \
    --cc=emil@etsalapatis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --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 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.