]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sched_ext: Move sources under kernel/sched/ext/
authorTejun Heo <tj@kernel.org>
Mon, 22 Jun 2026 15:32:54 +0000 (05:32 -1000)
committerTejun Heo <tj@kernel.org>
Mon, 22 Jun 2026 15:32:56 +0000 (05:32 -1000)
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.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
15 files changed:
Documentation/scheduler/sched-ext.rst
MAINTAINERS
kernel/sched/build_policy.c
kernel/sched/ext/arena.c [moved from kernel/sched/ext_arena.c with 100% similarity]
kernel/sched/ext/arena.h [moved from kernel/sched/ext_arena.h with 100% similarity]
kernel/sched/ext/cid.c [moved from kernel/sched/ext_cid.c with 99% similarity]
kernel/sched/ext/cid.h [moved from kernel/sched/ext_cid.h with 99% similarity]
kernel/sched/ext/ext.c [moved from kernel/sched/ext.c with 99% similarity]
kernel/sched/ext/ext.h [moved from kernel/sched/ext.h with 100% similarity]
kernel/sched/ext/idle.c [moved from kernel/sched/ext_idle.c with 100% similarity]
kernel/sched/ext/idle.h [moved from kernel/sched/ext_idle.h with 100% similarity]
kernel/sched/ext/internal.h [moved from kernel/sched/ext_internal.h with 100% similarity]
kernel/sched/ext/types.h [moved from kernel/sched/ext_types.h with 100% similarity]
kernel/sched/sched.h
tools/sched_ext/include/scx/cid.bpf.h

index c4f59c08d8a4f06a40dfc25240f1c5855754d241..4b1ffd03f5165868afbab1b053267b12ac1f9e52 100644 (file)
@@ -114,7 +114,7 @@ counters. Each counter occupies one ``name value`` line:
     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
index ba45953bb805d12808ebb4b520dd27f97d650b9d..2d853aadd919d81abc15f7f8bfdd34e3e16e6fa6 100644 (file)
@@ -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
 
index 067979a7b69ec8b9d889d7c4efda7b9ca0d9400a..d74b54f819927c4c6a72941e6f034111efe43a41 100644 (file)
 # 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"
similarity index 99%
rename from kernel/sched/ext_cid.c
rename to kernel/sched/ext/cid.c
index 66944a7ef79d18ded3c5342409017dacf9da1cab..aeaea88f34c55a611eaf0f09226a49816f0ef214 100644 (file)
@@ -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
similarity index 99%
rename from kernel/sched/ext_cid.h
rename to kernel/sched/ext/cid.h
index 5745e5785e897ecbb14efe30d1c662636b26a7d8..6e657fd147b0452a18f276a04e647d0bfdb51bf0 100644 (file)
@@ -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;
similarity index 99%
rename from kernel/sched/ext.c
rename to kernel/sched/ext/ext.c
index 0db6fa2daea39cbe1acc4c04b1c4a4379fd1a2f8..00fe6cc6d7e2796079d41854a4d82d9de07b63c8 100644 (file)
@@ -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,
similarity index 100%
rename from kernel/sched/ext.h
rename to kernel/sched/ext/ext.h
index c7c2dea65edd90d780a8be0f8cde0bdf402d0e22..56acf502ba260ab18bacd7a4c2efdec612d50125 100644 (file)
@@ -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 */
index 9d89bb57e201b2b7a95ec63e92a9144f3ec5b9b1..db247e42fb45fa359cc5b5ed3f298dc456ccf836 100644 (file)
@@ -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 {