All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tejun Heo" <tj@kernel.org>
Cc: sched-ext@lists.linux.dev
Subject: Re: [PATCH 2/4] sched_ext: Move scx_dispatch_sched() from sub.h to internal.h
Date: Tue, 14 Jul 2026 23:35:49 +0000	[thread overview]
Message-ID: <20260714233549.EDF1D1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260714230917.84158-3-tj@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Moving `scx_dispatch_sched()` to `internal.h` and including `cid.h` at the end creates a circular header dependency. `cid.h` includes `internal.h` at the top. When `cid.h` is included first by a C file, it triggers the inclusion of `internal.h`. The `#include "cid.h"` at the end of `internal.h` is skipped by the include guard. Consequently, `scx_dispatch_sched()` is parsed before the rest of `cid.h` has been processed, resulting in an 'implicit declaration of function' compiler error for `scx_cpu_arg()`. This violates the kernel coding standard requiring headers to be self-contained and independently compilable.
--

--- Patch [2]: [PATCH 2/4] sched_ext: Move scx_dispatch_sched() from sub.h to internal.h ---
commit 6f0aa181637de48d619823a3e1db41e281070615
Author: Tejun Heo <tj@kernel.org>

sched_ext: Move scx_dispatch_sched() from sub.h to internal.h

This commit moves scx_dispatch_sched() from sub.h to internal.h,
and includes cid.h at the end of internal.h to support scx_cpu_arg().

> diff --git a/kernel/sched/ext/internal.h b/kernel/sched/ext/internal.h
> index d7a1d6a14ebf3..88b2a9b5d3ab2 100644
> --- a/kernel/sched/ext/internal.h
> +++ b/kernel/sched/ext/internal.h
> @@ -2289,4 +2289,115 @@ static inline struct scx_sched *scx_prog_sched(const struct bpf_prog_aux *aux)
>  static inline struct scx_sched *scx_parent(struct scx_sched *sch) { return NULL; }
>  #endif	/* CONFIG_EXT_SUB_SCHED */
>  
> +#include "cid.h"

[Severity: Low]
Does this create a circular header dependency between internal.h and cid.h?

If a C file includes cid.h before internal.h, cid.h includes internal.h
at the top. When processing internal.h, the #include "cid.h" here is
skipped by the include guard.

This causes scx_dispatch_sched() to be parsed before the rest of cid.h is
processed, which would result in an implicit declaration error for
scx_cpu_arg() further down in this function.

Could this cause build failures if headers are included in a different order
in the future?

> +
> +/*
> + * One user of this function is scx_bpf_dispatch() which can be called
> + * recursively as sub-sched dispatches nest. Always inline to reduce stack usage
> + * from the call frame.
> + */
> +static __always_inline bool
> +scx_dispatch_sched(struct scx_sched *sch, struct rq *rq,

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260714230917.84158-1-tj@kernel.org?part=2

  reply	other threads:[~2026-07-14 23:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14 23:09 [PATCHSET sched_ext/for-7.3] sched_ext: Sub-scheduler follow-ups Tejun Heo
2026-07-14 23:09 ` [PATCH 1/4] sched_ext: Remove queued ecaps syncs directly on sched teardown Tejun Heo
2026-07-14 23:09 ` [PATCH 2/4] sched_ext: Move scx_dispatch_sched() from sub.h to internal.h Tejun Heo
2026-07-14 23:35   ` sashiko-bot [this message]
2026-07-14 23:09 ` [PATCH 3/4] sched_ext: Gate sub_dispatch_prev with CONFIG_EXT_SUB_SCHED Tejun Heo
2026-07-14 23:09 ` [PATCH 4/4] sched_ext: Add the scx_has_subs static key and gate sub-sched hot paths 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=20260714233549.EDF1D1F000E9@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.