sched_ext: Move sources under kernel/sched/ext/
Subsystems (3)
Tejun Heo
reviewerPATCH 1/1 sched_ext: Move sources under kernel/sched/ext/
The sched_ext sources had grown to ten ext* files directly under kernel/sched/. Move them into a new kernel/sched/ext/ subdirectory and drop the now-redundant ext_ prefix. ext.c/h keep their names.
kernel/sched/ext.{c,h} -> kernel/sched/ext/ext.{c,h}
kernel/sched/ext_internal.h -> kernel/sched/ext/internal.h
kernel/sched/ext_types.h -> kernel/sched/ext/types.h
kernel/sched/ext_idle.{c,h} -> kernel/sched/ext/idle.{c,h}
kernel/sched/ext_cid.{c,h} -> kernel/sched/ext/cid.{c,h} kernel/sched/ext_arena.{c,h} -> kernel/sched/ext/arena.{c,h}
The include paths in build_policy.c and sched.h, the MAINTAINERS glob, and a few documentation and comment references are updated to match. No code or symbol changes.
---
I'm applying this to sched_ext/for-7.2 and sending it to Linus before the merge window closes so that for-7.2-fixes and for-7.3 don't diverge unnecessarily.
Thanks.
Documentation/scheduler/sched-ext.rst | 8 ++++----
MAINTAINERS | 2 +-
kernel/sched/build_policy.c | 18 +++++++++---------
kernel/sched/{ext_arena.c => ext/arena.c} | 0
kernel/sched/{ext_arena.h => ext/arena.h} | 0
kernel/sched/{ext_cid.c => ext/cid.c} | 2 +-
kernel/sched/{ext_cid.h => ext/cid.h} | 0
kernel/sched/{ => ext}/ext.c | 2 +-
kernel/sched/{ => ext}/ext.h | 0
kernel/sched/{ext_idle.c => ext/idle.c} | 0
kernel/sched/{ext_idle.h => ext/idle.h} | 0
.../sched/{ext_internal.h => ext/internal.h} | 0
kernel/sched/{ext_types.h => ext/types.h} | 0
kernel/sched/sched.h | 2 +-
tools/sched_ext/include/scx/cid.bpf.h | 6 +++---
15 files changed, 20 insertions(+), 20 deletions(-)
rename kernel/sched/{ext_arena.c => ext/arena.c} (100%)
rename kernel/sched/{ext_arena.h => ext/arena.h} (100%)
rename kernel/sched/{ext_cid.c => ext/cid.c} (99%)
rename kernel/sched/{ext_cid.h => ext/cid.h} (100%)
rename kernel/sched/{ => ext}/ext.c (99%)
rename kernel/sched/{ => ext}/ext.h (100%)
rename kernel/sched/{ext_idle.c => ext/idle.c} (100%)
rename kernel/sched/{ext_idle.h => ext/idle.h} (100%)
rename kernel/sched/{ext_internal.h => ext/internal.h} (100%)
rename kernel/sched/{ext_types.h => ext/types.h} (100%)Documentation/scheduler/sched-ext.rst +4 -4
@@ -114,7 +114,7 @@ Each running scheduler also exposes a per-scheduler ``events`` file under SCX_EV_INSERT_NOT_OWNED 0 SCX_EV_SUB_BYPASS_DISPATCH 0 -The counters are described in ``kernel/sched/ext_internal.h``; briefly: +The counters are described in ``kernel/sched/ext/internal.h``; briefly: * ``SCX_EV_SELECT_CPU_FALLBACK``: ops.select_cpu() returned a CPU unusable by the task and the core scheduler silently picked a fallback CPU.
@@ -496,11 +496,11 @@ Where to Look * ``include/linux/sched/ext.h`` defines the core data structures, ops table and constants. -* ``kernel/sched/ext.c`` contains sched_ext core implementation and helpers. +* ``kernel/sched/ext/ext.c`` contains sched_ext core implementation and helpers. The functions prefixed with ``scx_bpf_`` can be called from the BPF scheduler. -* ``kernel/sched/ext_idle.c`` contains the built-in idle CPU selection policy. +* ``kernel/sched/ext/idle.c`` contains the built-in idle CPU selection policy. * ``tools/sched_ext/`` hosts example BPF scheduler implementations.
@@ -557,7 +557,7 @@ ABI Instability The APIs provided by sched_ext to BPF schedulers programs have no stability guarantees. This includes the ops table callbacks and constants defined in ``include/linux/sched/ext.h``, as well as the ``scx_bpf_`` kfuncs defined in -``kernel/sched/ext.c`` and ``kernel/sched/ext_idle.c``. +``kernel/sched/ext/ext.c`` and ``kernel/sched/ext/idle.c``. While we will attempt to provide a relatively stable API surface when possible, they are subject to change without warning between kernel
MAINTAINERS +1 -1
@@ -24164,7 +24164,7 @@ S: Maintained W: https://github.com/sched-ext/scx T: git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git F: include/linux/sched/ext.h -F: kernel/sched/ext* +F: kernel/sched/ext/ F: tools/sched_ext/ F: tools/testing/selftests/sched_ext
kernel/sched/build_policy.c +9 -9
@@ -61,15 +61,15 @@# include <linux/btf_ids.h> # include <linux/find.h> # include <linux/genalloc.h> -# include "ext_types.h" -# include "ext_internal.h" -# include "ext_cid.h" -# include "ext_arena.h" -# include "ext_idle.h" -# include "ext.c" -# include "ext_cid.c" -# include "ext_arena.c" -# include "ext_idle.c" +# include "ext/types.h" +# include "ext/internal.h" +# include "ext/cid.h" +# include "ext/arena.h" +# include "ext/idle.h" +# include "ext/ext.c" +# include "ext/cid.c" +# include "ext/arena.c" +# include "ext/idle.c" #endif #include "syscalls.c"
kernel/sched/ext/arena.c renamed from kernel/sched/ext_arena.c +0 -0
kernel/sched/ext/arena.h renamed from kernel/sched/ext_arena.h +0 -0
kernel/sched/ext/cid.c renamed from kernel/sched/ext_cid.c +1 -1
@@ -71,7 +71,7 @@ static s32 scx_cid_arrays_alloc(void)* scx_cid_init - build the cid mapping * @sch: the scx_sched being initialized; used as the scx_error() target * -* See "Topological CPU IDs" in ext_cid.h for the model. Walk online cpus by +* See "Topological CPU IDs" in cid.h for the model. Walk online cpus by * intersection at each level (parent_scratch & this_level_mask), which keeps * containment correct by construction and naturally splits a physical LLC * straddling two NUMA nodes into two LLC units. The caller must hold
kernel/sched/ext/cid.h renamed from kernel/sched/ext_cid.h +0 -0
kernel/sched/ext/ext.c renamed from kernel/sched/ext.c +1 -1
@@ -513,7 +513,7 @@ do { \ }while (0 )/* -* Flipped on enable per sch->is_cid_type. Declared in ext_internal.h so +* Flipped on enable per sch->is_cid_type. Declared in internal.h so * subsystem inlines can read it. */ DEFINE_STATIC_KEY_FALSE (__scx_is_cid_type);
kernel/sched/ext/ext.h renamed from kernel/sched/ext.h +0 -0
kernel/sched/ext/idle.c renamed from kernel/sched/ext_idle.c +0 -0
kernel/sched/ext/idle.h renamed from kernel/sched/ext_idle.h +0 -0
kernel/sched/ext/internal.h renamed from kernel/sched/ext_internal.h +0 -0
kernel/sched/ext/types.h renamed from kernel/sched/ext_types.h +0 -0
kernel/sched/sched.h +1 -1
@@ -4211,6 +4211,6 @@ DEFINE_CLASS(sched_change, struct sched_change_ctx *, DEFINE_CLASS_IS_UNCONDITIONAL(sched_change) -#include "ext.h" +#include "ext/ext.h" #endif /* _KERNEL_SCHED_SCHED_H */
tools/sched_ext/include/scx/cid.bpf.h +3 -3
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ /* -* BPF-side helpers for cids and cmasks. See kernel/sched/ext_cid.h for the +* BPF-side helpers for cids and cmasks. See kernel/sched/ext/cid.h for the * authoritative layout and semantics. The BPF-side helpers use the cmask_* * naming (no scx_ prefix); cmask is the SCX bitmap type so the prefix is * redundant in BPF code. Atomics use __sync_val_compare_and_swap and every
@@ -33,7 +33,7 @@#endif /* -* Mirrors SCX_CMASK_NR_WORDS in kernel/sched/ext_types.h. The u64 cast keeps +* Mirrors SCX_CMASK_NR_WORDS in kernel/sched/ext/types.h. The u64 cast keeps * the +63 from wrapping when @nr_cids is near U32_MAX, so cmask_reframe() * bounds-checking the result against alloc_words catches the overflow instead * of seeing a small value.
@@ -281,7 +281,7 @@ static __always_inline void cmask_zero(struct scx_cmask __arena *m)/* * BPF_-prefixed to avoid colliding with the kernel's anonymous CMASK_OP_* -* enum in ext_cid.c, which is exported via BTF and reachable through +* enum in ext/cid.c, which is exported via BTF and reachable through * vmlinux.h. */ enum {
Signature · 1 line
2.54.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Stale file name references to the renamed file `ext_cid.c` were left in comments. --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Stale file name references to the renamed file ext_cid.c were left in comments. --
commit 14b1d7b00c99cf24d69bf37c03dd5f2f1c7a83d3
Author: Tejun Heo <[email protected]>
sched_ext: Move sources under kernel/sched/ext/
The sched_ext sources had grown to ten ext* files directly under kernel/sched/. Move them into a new kernel/sched/ext/ subdirectory and drop the now-redundant ext_ prefix. ext.c/h keep their names.
Quoted 8 lines
kernel/sched/ext/cid.c renamed from kernel/sched/ext_cid.c +0
-0
kernel/sched/ext/cid.c static s32 scx_cid_arrays_alloc(void) · line 75
Quoted 6 lines
kernel/sched/ext/cid.c renamed from kernel/sched/ext_cid.c +1
-1@@ -71,7 +71,7 @@ static s32 scx_cid_arrays_alloc(void)* scx_cid_init - build the cid mapping * @sch: the scx_sched being initialized; used as the scx_error() target * -* See "Topological CPU IDs" in ext_cid.h for the model. Walk online cpus by +* See "Topological CPU IDs" in cid.h for the model. Walk online cpus by * intersection at each level (parent_scratch & this_level_mask), which keeps
[Severity: Low]
Were some stale file name references to ext_cid.c missed in the comments?
While this hunk updates the reference from ext_cid.h to cid.h, the block comment in kernel/sched/ext/cid.h still references ext_cid.c:
kernel/sched/ext/cid.h:
* possible-but-not-online cpus and carries all-(-1) topo info (see
* scx_cid_topo); callers detect it via the -1 sentinels. *
* See the comment above the table definitions in ext_cid.c for the
* memory-ordering and visibility contract.
And the kernel-doc comment for scx_call_op_set_cpumask() also still references it:
kernel/sched/ext/ext.c:scx_call_op_set_cpumask() {
* @cpumask: new cpumask
*
* For cid-form schedulers, translate @cpumask to a cmask via the per-cpu
* scratch in ext_cid.c and dispatch through the ops_cid union view. Caller
* must hold @rq's rq lock so this_cpu_ptr is stable across the call. */
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Tejun Heo
reviewerPATCH v2 1/1 sched_ext: Move sources under kernel/sched/ext/
In reply to Tejun HeoThe sched_ext sources had grown to ten ext* files directly under kernel/sched/. Move them into a new kernel/sched/ext/ subdirectory and drop the now-redundant ext_ prefix. ext.c/h keep their names.
kernel/sched/ext.{c,h} -> kernel/sched/ext/ext.{c,h}
kernel/sched/ext_internal.h -> kernel/sched/ext/internal.h
kernel/sched/ext_types.h -> kernel/sched/ext/types.h
kernel/sched/ext_idle.{c,h} -> kernel/sched/ext/idle.{c,h}
kernel/sched/ext_cid.{c,h} -> kernel/sched/ext/cid.{c,h} kernel/sched/ext_arena.{c,h} -> kernel/sched/ext/arena.{c,h}
The include paths in build_policy.c and sched.h, the MAINTAINERS glob, and a few documentation and comment references are updated to match. No code or symbol changes.
---
v2: Update two ext_cid.c comment references the rename missed in cid.h and
ext.c (sashiko AI).
I'm applying this to sched_ext/for-7.2 and sending it to Linus before the merge window closes so that for-7.2-fixes and for-7.3 don't diverge unnecessarily.
Thanks.
Documentation/scheduler/sched-ext.rst | 8 ++++----
MAINTAINERS | 2 +-
kernel/sched/build_policy.c | 18 +++++++++---------
kernel/sched/{ext_arena.c => ext/arena.c} | 0
kernel/sched/{ext_arena.h => ext/arena.h} | 0
kernel/sched/{ext_cid.c => ext/cid.c} | 2 +-
kernel/sched/{ext_cid.h => ext/cid.h} | 2 +-
kernel/sched/{ => ext}/ext.c | 4 ++--
kernel/sched/{ => ext}/ext.h | 0
kernel/sched/{ext_idle.c => ext/idle.c} | 0
kernel/sched/{ext_idle.h => ext/idle.h} | 0
.../sched/{ext_internal.h => ext/internal.h} | 0
kernel/sched/{ext_types.h => ext/types.h} | 0
kernel/sched/sched.h | 2 +-
tools/sched_ext/include/scx/cid.bpf.h | 6 +++---
15 files changed, 22 insertions(+), 22 deletions(-)
rename kernel/sched/{ext_arena.c => ext/arena.c} (100%)
rename kernel/sched/{ext_arena.h => ext/arena.h} (100%)
rename kernel/sched/{ext_cid.c => ext/cid.c} (99%)
rename kernel/sched/{ext_cid.h => ext/cid.h} (99%)
rename kernel/sched/{ => ext}/ext.c (99%)
rename kernel/sched/{ => ext}/ext.h (100%)
rename kernel/sched/{ext_idle.c => ext/idle.c} (100%)
rename kernel/sched/{ext_idle.h => ext/idle.h} (100%)
rename kernel/sched/{ext_internal.h => ext/internal.h} (100%)
rename kernel/sched/{ext_types.h => ext/types.h} (100%)Documentation/scheduler/sched-ext.rst +4 -4
@@ -114,7 +114,7 @@ Each running scheduler also exposes a per-scheduler ``events`` file under SCX_EV_INSERT_NOT_OWNED 0 SCX_EV_SUB_BYPASS_DISPATCH 0 -The counters are described in ``kernel/sched/ext_internal.h``; briefly: +The counters are described in ``kernel/sched/ext/internal.h``; briefly: * ``SCX_EV_SELECT_CPU_FALLBACK``: ops.select_cpu() returned a CPU unusable by the task and the core scheduler silently picked a fallback CPU.
@@ -496,11 +496,11 @@ Where to Look * ``include/linux/sched/ext.h`` defines the core data structures, ops table and constants. -* ``kernel/sched/ext.c`` contains sched_ext core implementation and helpers. +* ``kernel/sched/ext/ext.c`` contains sched_ext core implementation and helpers. The functions prefixed with ``scx_bpf_`` can be called from the BPF scheduler. -* ``kernel/sched/ext_idle.c`` contains the built-in idle CPU selection policy. +* ``kernel/sched/ext/idle.c`` contains the built-in idle CPU selection policy. * ``tools/sched_ext/`` hosts example BPF scheduler implementations.
@@ -557,7 +557,7 @@ ABI Instability The APIs provided by sched_ext to BPF schedulers programs have no stability guarantees. This includes the ops table callbacks and constants defined in ``include/linux/sched/ext.h``, as well as the ``scx_bpf_`` kfuncs defined in -``kernel/sched/ext.c`` and ``kernel/sched/ext_idle.c``. +``kernel/sched/ext/ext.c`` and ``kernel/sched/ext/idle.c``. While we will attempt to provide a relatively stable API surface when possible, they are subject to change without warning between kernel
MAINTAINERS +1 -1
@@ -24164,7 +24164,7 @@ S: Maintained W: https://github.com/sched-ext/scx T: git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git F: include/linux/sched/ext.h -F: kernel/sched/ext* +F: kernel/sched/ext/ F: tools/sched_ext/ F: tools/testing/selftests/sched_ext
kernel/sched/build_policy.c +9 -9
@@ -61,15 +61,15 @@# include <linux/btf_ids.h> # include <linux/find.h> # include <linux/genalloc.h> -# include "ext_types.h" -# include "ext_internal.h" -# include "ext_cid.h" -# include "ext_arena.h" -# include "ext_idle.h" -# include "ext.c" -# include "ext_cid.c" -# include "ext_arena.c" -# include "ext_idle.c" +# include "ext/types.h" +# include "ext/internal.h" +# include "ext/cid.h" +# include "ext/arena.h" +# include "ext/idle.h" +# include "ext/ext.c" +# include "ext/cid.c" +# include "ext/arena.c" +# include "ext/idle.c" #endif #include "syscalls.c"
kernel/sched/ext/arena.c renamed from kernel/sched/ext_arena.c +0 -0
kernel/sched/ext/arena.h renamed from kernel/sched/ext_arena.h +0 -0
kernel/sched/ext/cid.c renamed from kernel/sched/ext_cid.c +1 -1
@@ -71,7 +71,7 @@ static s32 scx_cid_arrays_alloc(void)* scx_cid_init - build the cid mapping * @sch: the scx_sched being initialized; used as the scx_error() target * -* See "Topological CPU IDs" in ext_cid.h for the model. Walk online cpus by +* See "Topological CPU IDs" in cid.h for the model. Walk online cpus by * intersection at each level (parent_scratch & this_level_mask), which keeps * containment correct by construction and naturally splits a physical LLC * straddling two NUMA nodes into two LLC units. The caller must hold
kernel/sched/ext/cid.h renamed from kernel/sched/ext_cid.h +1 -1
@@ -43,7 +43,7 @@ struct scx_sched;* possible-but-not-online cpus and carries all-(-1) topo info (see * scx_cid_topo); callers detect it via the -1 sentinels. * -* See the comment above the table definitions in ext_cid.c for the +* See the comment above the table definitions in cid.c for the * memory-ordering and visibility contract. */ extern s16 *scx_cid_to_cpu_tbl;
kernel/sched/ext/ext.c renamed from kernel/sched/ext.c +2 -2
@@ -513,7 +513,7 @@ do { \ }while (0 )/* -* Flipped on enable per sch->is_cid_type. Declared in ext_internal.h so +* Flipped on enable per sch->is_cid_type. Declared in internal.h so * subsystem inlines can read it. */ DEFINE_STATIC_KEY_FALSE (__scx_is_cid_type);
@@ -608,7 +608,7 @@ do { \* @cpumask: new cpumask * * For cid-form schedulers, translate @cpumask to a cmask via the per-cpu -* scratch in ext_cid.c and dispatch through the ops_cid union view. Caller +* scratch in cid.c and dispatch through the ops_cid union view. Caller * must hold @rq's rq lock so this_cpu_ptr is stable across the call. */ static inline void scx_call_op_set_cpumask(struct scx_sched *sch, struct rq *rq,
kernel/sched/ext/ext.h renamed from kernel/sched/ext.h +0 -0
kernel/sched/ext/idle.c renamed from kernel/sched/ext_idle.c +0 -0
kernel/sched/ext/idle.h renamed from kernel/sched/ext_idle.h +0 -0
kernel/sched/ext/internal.h renamed from kernel/sched/ext_internal.h +0 -0
kernel/sched/ext/types.h renamed from kernel/sched/ext_types.h +0 -0
kernel/sched/sched.h +1 -1
@@ -4211,6 +4211,6 @@ DEFINE_CLASS(sched_change, struct sched_change_ctx *, DEFINE_CLASS_IS_UNCONDITIONAL(sched_change) -#include "ext.h" +#include "ext/ext.h" #endif /* _KERNEL_SCHED_SCHED_H */
tools/sched_ext/include/scx/cid.bpf.h +3 -3
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ /* -* BPF-side helpers for cids and cmasks. See kernel/sched/ext_cid.h for the +* BPF-side helpers for cids and cmasks. See kernel/sched/ext/cid.h for the * authoritative layout and semantics. The BPF-side helpers use the cmask_* * naming (no scx_ prefix); cmask is the SCX bitmap type so the prefix is * redundant in BPF code. Atomics use __sync_val_compare_and_swap and every
@@ -33,7 +33,7 @@#endif /* -* Mirrors SCX_CMASK_NR_WORDS in kernel/sched/ext_types.h. The u64 cast keeps +* Mirrors SCX_CMASK_NR_WORDS in kernel/sched/ext/types.h. The u64 cast keeps * the +63 from wrapping when @nr_cids is near U32_MAX, so cmask_reframe() * bounds-checking the result against alloc_words catches the overflow instead * of seeing a small value.
@@ -281,7 +281,7 @@ static __always_inline void cmask_zero(struct scx_cmask __arena *m)/* * BPF_-prefixed to avoid colliding with the kernel's anonymous CMASK_OP_* -* enum in ext_cid.c, which is exported via BTF and reachable through +* enum in ext/cid.c, which is exported via BTF and reachable through * vmlinux.h. */ enum {
Signature · 1 line
2.54.0
Hi Tejun,
Quoted 9 lines · Tejun Heo
The
sched_extsources had grown to ten ext* files directly underkernel/sched/. Move them into a newkernel/sched/ext/subdirectory and drop the now-redundantext_prefix. ext.c/h keep their names.kernel/sched/ext.{c,h} -> kernel/sched/ext/ext.{c,h} kernel/sched/ext_internal.h -> kernel/sched/ext/internal.h kernel/sched/ext_types.h -> kernel/sched/ext/types.h kernel/sched/ext_idle.{c,h} -> kernel/sched/ext/idle.{c,h} kernel/sched/ext_cid.{c,h} -> kernel/sched/ext/cid.{c,h}
Quoted 8 lines
kernel/sched/ext_arena.{c,h}->kernel/sched/ext/arena.{c,h}The include paths in
build_policy.candsched.h, theMAINTAINERSglob, and a few documentation and comment references are updated to match. No code or symbol changes.Suggested-by Linus Torvalds <[email protected]>Signed-off-by Tejun Heo <[email protected]>
Looks good to me. I also double checked for any potential stale references after the rename, but couldn't find any.
Thanks,
-Andrea
Quoted 245 lines
---
v2: Update twoext_cid.ccomment references the rename missed incid.hand
ext.c(sashiko AI).I'm applying this to sched_ext/for-7.2 and sending it to Linus before the merge window closes so that for-7.2-fixes and for-7.3 don't diverge unnecessarily.
Thanks.
Documentation/scheduler/sched-ext.rst | 8 ++++---- MAINTAINERS | 2 +- kernel/sched/build_policy.c | 18 +++++++++--------- kernel/sched/{ext_arena.c => ext/arena.c} | 0 kernel/sched/{ext_arena.h => ext/arena.h} | 0 kernel/sched/{ext_cid.c => ext/cid.c} | 2 +- kernel/sched/{ext_cid.h => ext/cid.h} | 2 +- kernel/sched/{ => ext}/ext.c | 4 ++-- kernel/sched/{ => ext}/ext.h | 0 kernel/sched/{ext_idle.c => ext/idle.c} | 0 kernel/sched/{ext_idle.h => ext/idle.h} | 0 .../sched/{ext_internal.h => ext/internal.h} | 0 kernel/sched/{ext_types.h => ext/types.h} | 0 kernel/sched/sched.h | 2 +- tools/sched_ext/include/scx/cid.bpf.h | 6 +++--- 15 files changed, 22 insertions(+), 22 deletions(-) rename kernel/sched/{ext_arena.c => ext/arena.c} (100%) rename kernel/sched/{ext_arena.h => ext/arena.h} (100%) rename kernel/sched/{ext_cid.c => ext/cid.c} (99%) rename kernel/sched/{ext_cid.h => ext/cid.h} (99%) rename kernel/sched/{ => ext}/ext.c (99%) rename kernel/sched/{ => ext}/ext.h (100%) rename kernel/sched/{ext_idle.c => ext/idle.c} (100%) rename kernel/sched/{ext_idle.h => ext/idle.h} (100%) rename kernel/sched/{ext_internal.h => ext/internal.h} (100%) rename kernel/sched/{ext_types.h => ext/types.h} (100%)Documentation/scheduler/sched-ext.rst +4
-4@@ -114,7 +114,7 @@ Each running scheduler also exposes a per-scheduler ``events`` file under SCX_EV_INSERT_NOT_OWNED 0 SCX_EV_SUB_BYPASS_DISPATCH 0 -The counters are described in ``kernel/sched/ext_internal.h``; briefly: +The counters are described in ``kernel/sched/ext/internal.h``; briefly: * ``SCX_EV_SELECT_CPU_FALLBACK``: ops.select_cpu() returned a CPU unusable by the task and the core scheduler silently picked a fallback CPU.@@ -496,11 +496,11 @@ Where to Look * ``include/linux/sched/ext.h`` defines the core data structures, ops table and constants. -* ``kernel/sched/ext.c`` contains sched_ext core implementation and helpers. +* ``kernel/sched/ext/ext.c`` contains sched_ext core implementation and helpers. The functions prefixed with ``scx_bpf_`` can be called from the BPF scheduler. -* ``kernel/sched/ext_idle.c`` contains the built-in idle CPU selection policy. +* ``kernel/sched/ext/idle.c`` contains the built-in idle CPU selection policy. * ``tools/sched_ext/`` hosts example BPF scheduler implementations.@@ -557,7 +557,7 @@ ABI Instability The APIs provided by sched_ext to BPF schedulers programs have no stability guarantees. This includes the ops table callbacks and constants defined in ``include/linux/sched/ext.h``, as well as the ``scx_bpf_`` kfuncs defined in -``kernel/sched/ext.c`` and ``kernel/sched/ext_idle.c``. +``kernel/sched/ext/ext.c`` and ``kernel/sched/ext/idle.c``. While we will attempt to provide a relatively stable API surface when possible, they are subject to change without warning between kernelMAINTAINERS +1
-1@@ -24164,7 +24164,7 @@ S: Maintained W: https://github.com/sched-ext/scx T: git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git F: include/linux/sched/ext.h -F: kernel/sched/ext* +F: kernel/sched/ext/ F: tools/sched_ext/ F: tools/testing/selftests/sched_extkernel/sched/build_policy.c +9
-9@@ -61,15 +61,15 @@# include <linux/btf_ids.h> # include <linux/find.h> # include <linux/genalloc.h> -# include "ext_types.h" -# include "ext_internal.h" -# include "ext_cid.h" -# include "ext_arena.h" -# include "ext_idle.h" -# include "ext.c" -# include "ext_cid.c" -# include "ext_arena.c" -# include "ext_idle.c" +# include "ext/types.h" +# include "ext/internal.h" +# include "ext/cid.h" +# include "ext/arena.h" +# include "ext/idle.h" +# include "ext/ext.c" +# include "ext/cid.c" +# include "ext/arena.c" +# include "ext/idle.c" #endif #include "syscalls.c" kernel/sched/ext/arena.c renamed from kernel/sched/ext_arena.c +0
-0kernel/sched/ext/arena.h renamed from kernel/sched/ext_arena.h +0
-0kernel/sched/ext/cid.c renamed from kernel/sched/ext_cid.c +1
-1@@ -71,7 +71,7 @@ static s32 scx_cid_arrays_alloc(void)* scx_cid_init - build the cid mapping * @sch: the scx_sched being initialized; used as the scx_error() target * -* See "Topological CPU IDs" in ext_cid.h for the model. Walk online cpus by +* See "Topological CPU IDs" in cid.h for the model. Walk online cpus by * intersection at each level (parent_scratch & this_level_mask), which keeps * containment correct by construction and naturally splits a physical LLC * straddling two NUMA nodes into two LLC units. The caller must hold kernel/sched/ext/cid.h renamed from kernel/sched/ext_cid.h +1
-1@@ -43,7 +43,7 @@ struct scx_sched;* possible-but-not-online cpus and carries all-(-1) topo info (see * scx_cid_topo); callers detect it via the -1 sentinels. * -* See the comment above the table definitions in ext_cid.c for the +* See the comment above the table definitions in cid.c for the * memory-ordering and visibility contract. */ extern s16 *scx_cid_to_cpu_tbl;kernel/sched/ext/ext.c renamed from kernel/sched/ext.c +2
-2@@ -513,7 +513,7 @@ do { \ }while (0 )/* -* Flipped on enable per sch->is_cid_type. Declared in ext_internal.h so +* Flipped on enable per sch->is_cid_type. Declared in internal.h so * subsystem inlines can read it. */ DEFINE_STATIC_KEY_FALSE (__scx_is_cid_type);@@ -608,7 +608,7 @@ do { \* @cpumask: new cpumask * * For cid-form schedulers, translate @cpumask to a cmask via the per-cpu -* scratch in ext_cid.c and dispatch through the ops_cid union view. Caller +* scratch in cid.c and dispatch through the ops_cid union view. Caller * must hold @rq's rq lock so this_cpu_ptr is stable across the call. */ static inline void scx_call_op_set_cpumask(struct scx_sched *sch, struct rq *rq,kernel/sched/ext/ext.h renamed from kernel/sched/ext.h +0
-0kernel/sched/ext/idle.c renamed from kernel/sched/ext_idle.c +0
-0kernel/sched/ext/idle.h renamed from kernel/sched/ext_idle.h +0
-0kernel/sched/ext/internal.h renamed from kernel/sched/ext_internal.h +0
-0kernel/sched/ext/types.h renamed from kernel/sched/ext_types.h +0
-0kernel/sched/sched.h +1
-1@@ -4211,6 +4211,6 @@ DEFINE_CLASS(sched_change, struct sched_change_ctx *, DEFINE_CLASS_IS_UNCONDITIONAL(sched_change) -#include "ext.h" +#include "ext/ext.h" #endif /* _KERNEL_SCHED_SCHED_H */ tools/sched_ext/include/scx/cid.bpf.h +3
-3@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ /* -* BPF-side helpers for cids and cmasks. See kernel/sched/ext_cid.h for the +* BPF-side helpers for cids and cmasks. See kernel/sched/ext/cid.h for the * authoritative layout and semantics. The BPF-side helpers use the cmask_* * naming (no scx_ prefix); cmask is the SCX bitmap type so the prefix is * redundant in BPF code. Atomics use __sync_val_compare_and_swap and every @@ -33,7 +33,7 @@#endif /* -* Mirrors SCX_CMASK_NR_WORDS in kernel/sched/ext_types.h. The u64 cast keeps +* Mirrors SCX_CMASK_NR_WORDS in kernel/sched/ext/types.h. The u64 cast keeps * the +63 from wrapping when @nr_cids is near U32_MAX, so cmask_reframe() * bounds-checking the result against alloc_words catches the overflow instead * of seeing a small value. @@ -281,7 +281,7 @@ static __always_inline void cmask_zero(struct scx_cmask __arena *m)/* * BPF_-prefixed to avoid colliding with the kernel's anonymous CMASK_OP_* -* enum in ext_cid.c, which is exported via BTF and reachable through +* enum in ext/cid.c, which is exported via BTF and reachable through * vmlinux.h. */ enum {Signature · 1 line
2.54.0
Quoted 9 lines · Tejun Heo
The
sched_extsources had grown to ten ext* files directly underkernel/sched/. Move them into a newkernel/sched/ext/subdirectory and drop the now-redundantext_prefix. ext.c/h keep their names.kernel/sched/ext.{c,h} -> kernel/sched/ext/ext.{c,h} kernel/sched/ext_internal.h -> kernel/sched/ext/internal.h kernel/sched/ext_types.h -> kernel/sched/ext/types.h kernel/sched/ext_idle.{c,h} -> kernel/sched/ext/idle.{c,h} kernel/sched/ext_cid.{c,h} -> kernel/sched/ext/cid.{c,h}
Quoted 8 lines
kernel/sched/ext_arena.{c,h}->kernel/sched/ext/arena.{c,h}The include paths in
build_policy.candsched.h, theMAINTAINERSglob, and a few documentation and comment references are updated to match. No code or symbol changes.Suggested-by Linus Torvalds <[email protected]>Signed-off-by Tejun Heo <[email protected]>
Applied to sched_ext/for-7.2.
Thanks.
Signature · 1 line
tejun
Peter Zijlstra
maintainerQuoted 9 lines · Tejun Heo
The
sched_extsources had grown to ten ext* files directly underkernel/sched/. Move them into a newkernel/sched/ext/subdirectory and drop the now-redundantext_prefix. ext.c/h keep their names.kernel/sched/ext.{c,h} -> kernel/sched/ext/ext.{c,h} kernel/sched/ext_internal.h -> kernel/sched/ext/internal.h kernel/sched/ext_types.h -> kernel/sched/ext/types.h kernel/sched/ext_idle.{c,h} -> kernel/sched/ext/idle.{c,h} kernel/sched/ext_cid.{c,h} -> kernel/sched/ext/cid.{c,h}
Quoted 8 lines
kernel/sched/ext_arena.{c,h}->kernel/sched/ext/arena.{c,h}The include paths in
build_policy.candsched.h, theMAINTAINERSglob, and a few documentation and comment references are updated to match. No code or symbol changes.Suggested-by Linus Torvalds <[email protected]>Signed-off-by Tejun Heo <[email protected]>
OK I suppose.
Can I take this opportunity to remind you that most of the ext files are not clangd 'clean' yet. That is, they don't cleanly compile as stand alone entities, which causes LSP/clangd enabled editors to throw a ton of errors.
Tejun Heo
reviewerQuoted 4 lines · Peter Zijlstra
Can I take this opportunity to remind you that most of the ext files are not clangd 'clean' yet. That is, they don't cleanly compile as stand alone entities, which causes LSP/clangd enabled editors to throw a ton of errors.
Ah yeah, let me clean that up too.
Thanks.
Signature · 1 line
tejun