From: sashiko-bot@kernel.org
To: "Tejun Heo" <tj@kernel.org>
Cc: sched-ext@lists.linux.dev
Subject: Re: [PATCH 1/3] sched_ext: Order single-cid cmask helpers as (cid, mask)
Date: Wed, 03 Jun 2026 17:31:23 +0000 [thread overview]
Message-ID: <20260603173124.312DC1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260603172153.3081861-2-tj@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Incomplete refactoring of cmask helpers argument order, causing an API divergence between kernel and BPF implementations.
--
commit cae9caa6c3655ef0cb4c126820c635529b2d5e19
Author: Tejun Heo <tj@kernel.org>
sched_ext: Order single-cid cmask helpers as (cid, mask)
This commit reorders the parameters of single-cid cmask helpers to take the
cid before the mask. This change is intended to make the parameters consistent
with standard kernel predicates like cpumask_test_cpu(cpu, mask).
> diff --git a/kernel/sched/ext_cid.h b/kernel/sched/ext_cid.h
> index abea22ba2cc25..46fd8eda04435 100644
> --- a/kernel/sched/ext_cid.h
> +++ b/kernel/sched/ext_cid.h
[ ... ]
> @@ -218,11 +218,11 @@ static inline void scx_cmask_reframe(struct scx_cmask *m, u32 base, u32 nr_cids)
> m->nr_cids = nr_cids;
> }
>
> -static inline void __scx_cmask_set(struct scx_cmask *m, u32 cid)
> +static inline void __scx_cmask_set(u32 cid, struct scx_cmask *m)
> {
> - if (!__scx_cmask_contains(m, cid))
> + if (!__scx_cmask_contains(cid, m))
> return;
> - *__scx_cmask_word(m, cid) |= BIT_U64(cid & 63);
> + *__scx_cmask_word(cid, m) |= BIT_U64(cid & 63);
> }
>
[Severity: Medium]
The commit message states the intent to reorder the cmask helpers for
consistency, but does this refactoring inadvertently omit the BPF-facing
helpers?
The kernel-side helpers in ext_cid.h are updated here to use the new
(cid, mask) order, but the equivalent functions in
tools/sched_ext/include/scx/cid.bpf.h appear to still use the old
(mask, cid) ordering:
tools/sched_ext/include/scx/cid.bpf.h:
static __always_inline void cmask_set(struct scx_cmask __arena *m, u32 cid)
static __always_inline bool cmask_test(const struct scx_cmask __arena *m, u32 cid)
static __always_inline bool __cmask_contains(const struct scx_cmask __arena *m, u32 cid)
Could this introduce an API divergence between the kernel and BPF
implementations for developers writing BPF schedulers?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260603172153.3081861-1-tj@kernel.org?part=1
next prev parent reply other threads:[~2026-06-03 17:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 17:21 [PATCHSET sched_ext/for-7.2] sched_ext: cid/cmask interface prep Tejun Heo
2026-06-03 17:21 ` [PATCH 1/3] sched_ext: Order single-cid cmask helpers as (cid, mask) Tejun Heo
2026-06-03 17:31 ` sashiko-bot [this message]
2026-06-03 17:21 ` [PATCH 2/3] sched_ext: Add scx_cmask_test() and scx_cmask_for_each_cid() Tejun Heo
2026-06-03 17:41 ` sashiko-bot
2026-06-03 17:21 ` [PATCH 3/3] sched_ext: Make scx_bpf_kick_cid() return s32 Tejun Heo
2026-06-03 18:38 ` Andrea Righi
2026-06-03 18:41 ` [PATCHSET sched_ext/for-7.2] sched_ext: cid/cmask interface prep 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=20260603173124.312DC1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sched-ext@lists.linux.dev \
--cc=tj@kernel.org \
/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.