| 9af832c0 | 03-Mar-2026 |
Zhao Mengmeng <zhaomengmeng@kylinos.cn> |
tools/sched_ext: Add -fms-extensions to bpf build flags
Similar to commit 835a50753579 ("selftests/bpf: Add -fms-extensions to bpf build flags") and commit 639f58a0f480 ("bpftool: Fix build warnings
tools/sched_ext: Add -fms-extensions to bpf build flags
Similar to commit 835a50753579 ("selftests/bpf: Add -fms-extensions to bpf build flags") and commit 639f58a0f480 ("bpftool: Fix build warnings due to MS extensions")
The kernel is now built with -fms-extensions, therefore generated vmlinux.h contains types like: struct aes_key { struct aes_enckey; union aes_invkey_arch inv_k; };
struct ns_common { ... union { struct ns_tree; struct callback_head ns_rcu; }; };
Which raise warning like below when building scx scheduler:
tools/sched_ext/build/include/vmlinux.h:50533:3: warning: declaration does not declare anything [-Wmissing-declarations] 50533 | struct ns_tree; | ^ Fix it by using -fms-extensions and -Wno-microsoft-anon-tag flags to build bpf programs that #include "vmlinux.h"
Signed-off-by: Zhao Mengmeng <zhaomengmeng@kylinos.cn> Reviewed-by: Andrea Righi <arighi@nvidia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| 032e084f | 27-Feb-2026 |
David Carlier <devnexen@gmail.com> |
tools/sched_ext: fix strtoul() misuse in scx_hotplug_seq()
scx_hotplug_seq() uses strtoul() but validates the result with a negative check (val < 0), which can never be true for an unsigned return v
tools/sched_ext: fix strtoul() misuse in scx_hotplug_seq()
scx_hotplug_seq() uses strtoul() but validates the result with a negative check (val < 0), which can never be true for an unsigned return value.
Use the endptr mechanism to verify the entire string was consumed, and check errno == ERANGE for overflow detection.
Signed-off-by: David Carlier <devnexen@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| ee0ff669 | 17-Feb-2026 |
Cheng-Yang Chou <yphbchou0911@gmail.com> |
tools/sched_ext: Add Kconfig to sync with upstream
Add the missing Kconfig file to tools/sched_ext/ as referenced in the README.
Ref: https://github.com/sched-ext/scx/blob/main/kernel.config
Signe
tools/sched_ext: Add Kconfig to sync with upstream
Add the missing Kconfig file to tools/sched_ext/ as referenced in the README.
Ref: https://github.com/sched-ext/scx/blob/main/kernel.config
Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| 095f5693 | 17-Feb-2026 |
Cheng-Yang Chou <yphbchou0911@gmail.com> |
tools/sched_ext: Sync README.md Kconfig with upstream scx
Sync the documentation with the upstream scx repository to reflect the current recommended configuration.
Ref: https://github.com/sched-ext
tools/sched_ext: Sync README.md Kconfig with upstream scx
Sync the documentation with the upstream scx repository to reflect the current recommended configuration.
Ref: https://github.com/sched-ext/scx/blob/main/README.md#build--install
Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| cbb29732 | 22-Feb-2026 |
Cheng-Yang Chou <yphbchou0911@gmail.com> |
tools/sched_ext: scx_sdt: Remove unused '-f' option
The '-f' option is defined in getopt() but not handled in the switch statement or documented in the help text. Providing '-f' currently triggers t
tools/sched_ext: scx_sdt: Remove unused '-f' option
The '-f' option is defined in getopt() but not handled in the switch statement or documented in the help text. Providing '-f' currently triggers the default error path.
Remove it to sync the optstring with the actual implementation.
Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| 640c9dc7 | 18-Feb-2026 |
David Carlier <devnexen@gmail.com> |
tools/sched_ext: fix getopt not re-parsed on restart
After goto restart, optind retains its advanced position from the previous getopt loop, causing getopt() to immediately return -1. This silently
tools/sched_ext: fix getopt not re-parsed on restart
After goto restart, optind retains its advanced position from the previous getopt loop, causing getopt() to immediately return -1. This silently drops all command-line options on the restarted skeleton.
Reset optind to 1 at the restart label so options are re-parsed.
Affected schedulers: scx_simple, scx_central, scx_flatcg, scx_pair, scx_sdt, scx_cpu0.
Signed-off-by: David Carlier <devnexen@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| f892f9f9 | 18-Feb-2026 |
David Carlier <devnexen@gmail.com> |
tools/sched_ext: scx_userland: fix data races on shared counters
The stats thread reads nr_vruntime_enqueues, nr_vruntime_dispatches, nr_vruntime_failed, and nr_curr_enqueued concurrently with the m
tools/sched_ext: scx_userland: fix data races on shared counters
The stats thread reads nr_vruntime_enqueues, nr_vruntime_dispatches, nr_vruntime_failed, and nr_curr_enqueued concurrently with the main thread writing them, with no synchronization.
Use __atomic builtins with relaxed ordering for all accesses to these counters to eliminate the data races.
Only display accuracy is affected, not scheduling correctness.
Signed-off-by: David Carlier <devnexen@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| 625be345 | 17-Feb-2026 |
David Carlier <devnexen@gmail.com> |
tools/sched_ext: scx_pair: fix stride == 0 crash on single-CPU systems
nr_cpu_ids / 2 produces stride 0 on a single-CPU system, which later causes SCX_BUG_ON(i == j) to fire. Validate stride after o
tools/sched_ext: scx_pair: fix stride == 0 crash on single-CPU systems
nr_cpu_ids / 2 produces stride 0 on a single-CPU system, which later causes SCX_BUG_ON(i == j) to fire. Validate stride after option parsing to also catch invalid user-supplied values via -S.
Signed-off-by: David Carlier <devnexen@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| 55a24d92 | 17-Feb-2026 |
David Carlier <devnexen@gmail.com> |
tools/sched_ext: scx_central: fix CPU_SET and skeleton leak on early exit
Use CPU_SET_S() instead of CPU_SET() on the dynamically allocated cpuset to avoid a potential out-of-bounds write when nr_cp
tools/sched_ext: scx_central: fix CPU_SET and skeleton leak on early exit
Use CPU_SET_S() instead of CPU_SET() on the dynamically allocated cpuset to avoid a potential out-of-bounds write when nr_cpu_ids exceeds CPU_SETSIZE.
Also destroy the skeleton before returning on invalid central CPU ID to prevent a resource leak.
Signed-off-by: David Carlier <devnexen@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| 07676846 | 14-Feb-2026 |
David Carlier <devnexen@gmail.com> |
tools/sched_ext: scx_userland: fix stale data on restart
Reset all counters, tasks and vruntime_head list on restart.
Signed-off-by: David Carlier <devnexen@gmail.com> Signed-off-by: Tejun Heo <tj@
tools/sched_ext: scx_userland: fix stale data on restart
Reset all counters, tasks and vruntime_head list on restart.
Signed-off-by: David Carlier <devnexen@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| cabd76bb | 14-Feb-2026 |
David Carlier <devnexen@gmail.com> |
tools/sched_ext: scx_flatcg: fix potential stack overflow from VLA in fcg_read_stats
fcg_read_stats() had a VLA allocating 21 * nr_cpus * 8 bytes on the stack, risking stack overflow on large CPU co
tools/sched_ext: scx_flatcg: fix potential stack overflow from VLA in fcg_read_stats
fcg_read_stats() had a VLA allocating 21 * nr_cpus * 8 bytes on the stack, risking stack overflow on large CPU counts (nr_cpus can be up to 512).
Fix by using a single heap allocation with the correct size, reusing it across all stat indices, and freeing it at the end.
Signed-off-by: David Carlier <devnexen@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| 048714d9 | 12-Feb-2026 |
David Carlier <devnexen@gmail.com> |
tools/sched_ext: scx_userland: fix restart and stats thread lifecycle bugs
Fix three issues in scx_userland's restart path:
- exit_req is not reset on restart, causing sched_main_loop() to exit i
tools/sched_ext: scx_userland: fix restart and stats thread lifecycle bugs
Fix three issues in scx_userland's restart path:
- exit_req is not reset on restart, causing sched_main_loop() to exit immediately without doing any scheduling work.
- stats_printer thread handle is local to spawn_stats_thread(), making it impossible to join from main(). Promote it to file scope.
- The stats thread continues reading skel->bss after the skeleton is destroyed on restart, causing a use-after-free. Join the stats thread before destroying the skeleton to ensure it has exited.
Signed-off-by: David Carlier <devnexen@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| 988369d2 | 11-Feb-2026 |
David Carlier <devnexen@gmail.com> |
tools/sched_ext: scx_central: fix sched_setaffinity() call with the set size
The cpu set is dynamically allocated for nr_cpu_ids using CPU_ALLOC(), so the size passed to sched_setaffinity() should b
tools/sched_ext: scx_central: fix sched_setaffinity() call with the set size
The cpu set is dynamically allocated for nr_cpu_ids using CPU_ALLOC(), so the size passed to sched_setaffinity() should be CPU_ALLOC_SIZE() rather than sizeof(cpu_set_t). Valgrind flagged this as accessing unaddressable bytes past the allocation.
Signed-off-by: David Carlier <devnexen@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| 2e06d54e | 02-Feb-2026 |
Emil Tsalapatis <emil@etsalapatis.com> |
tools/sched_ext: Fix data header access during free in scx_sdt
Fix a pointer arithmetic error in scx_sdt during freeing that causes the allocator to use the wrong memory address for the allocation's
tools/sched_ext: Fix data header access during free in scx_sdt
Fix a pointer arithmetic error in scx_sdt during freeing that causes the allocator to use the wrong memory address for the allocation's data header.
Fixes: 36929ebd17ae ("tools/sched_ext: add arena based scheduler") Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com> Acked-by: Andrea Righi <arighi@nvidia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| bd4f0822 | 30-Jan-2026 |
zhidao su <soolaugust@gmail.com> |
tools/sched_ext: Add error logging for dsq creation failures in remaining schedulers
Add scx_bpf_error() calls when scx_bpf_create_dsq() fails in the remaining schedulers to improve debuggability:
tools/sched_ext: Add error logging for dsq creation failures in remaining schedulers
Add scx_bpf_error() calls when scx_bpf_create_dsq() fails in the remaining schedulers to improve debuggability:
- scx_simple.bpf.c: simple_init() - scx_sdt.bpf.c: sdt_init() - scx_cpu0.bpf.c: cpu0_init() - scx_flatcg.bpf.c: fcg_init()
This follows the same pattern established in commit 2f8d489897ae ("sched_ext: Add error logging for dsq creation failures") for other schedulers and ensures consistent error reporting across all schedulers.
Signed-off-by: zhidao su <suzhidao@xiaomi.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| 36929ebd | 23-Jan-2026 |
Emil Tsalapatis <emil@etsalapatis.com> |
tools/sched_ext: add arena based scheduler
Add a scheduler that uses BPF arenas to manage task context data.
Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com> Signed-off-by: Tejun Heo <tj@kerne
tools/sched_ext: add arena based scheduler
Add a scheduler that uses BPF arenas to manage task context data.
Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| f0262b10 | 23-Jan-2026 |
Emil Tsalapatis <emil@etsalapatis.com> |
tools/sched_ext: add scx_pair scheduler
Add the scx_pair cgroup-based core scheduler.
Cc: Tejun Heo <tj@kernel.org> Cc: David Vernet <dvernet@meta.com> Signed-off-by: Emil Tsalapatis <emil@etsalapa
tools/sched_ext: add scx_pair scheduler
Add the scx_pair cgroup-based core scheduler.
Cc: Tejun Heo <tj@kernel.org> Cc: David Vernet <dvernet@meta.com> Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| cc4448d0 | 23-Jan-2026 |
Emil Tsalapatis <emil@etsalapatis.com> |
tools/sched_ext: add scx_userland scheduler
Add in the scx_userland scheduler that does vruntime-based scheduling in userspace code and communicates scheduling decisions to BPF by accessing and modi
tools/sched_ext: add scx_userland scheduler
Add in the scx_userland scheduler that does vruntime-based scheduling in userspace code and communicates scheduling decisions to BPF by accessing and modifying globals through the skeleton.
Cc: Tejun Heo <tj@kernel.org> Cc: David Vernet <dvernet@meta.com> Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|
| c9894e6f | 26-Dec-2025 |
Kohei Enju <enjuk@amazon.com> |
tools/sched_ext: update scx_show_state.py for scx_aborting change
Commit a69040ed57f5 ("sched_ext: Simplify breather mechanism with scx_aborting flag") removed scx_in_softlockup and scx_breather_dep
tools/sched_ext: update scx_show_state.py for scx_aborting change
Commit a69040ed57f5 ("sched_ext: Simplify breather mechanism with scx_aborting flag") removed scx_in_softlockup and scx_breather_depth, replacing them with scx_aborting.
Update the script accordingly.
Fixes: a69040ed57f5 ("sched_ext: Simplify breather mechanism with scx_aborting flag") Signed-off-by: Kohei Enju <enjuk@amazon.com> Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com> Signed-off-by: Tejun Heo <tj@kernel.org>
show more ...
|