Re: [PATCH 2/4] sched_ext: Move scx_dispatch_sched() from sub.h to internal.h
[email protected] Tue, 14 Jul 2026 23:35:49 +0000
| Newsgroups | dev.linux.lists.sched-ext |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> 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/[email protected]?part=2