Linux 6.18 sched_ext Preps For Cgroup Sub-Scheduler Support
([Linux Kernel] 6 Hours Ago
sched_ext)
- Reference: 0001580823
- News link: https://www.phoronix.com/news/Linux-6.18-sched-ext
- Source link:
The [1]sched_ext scheduler framework that allows creating kernel thread schedulers via BPF programs is ready with some updates for the [2]Linux 6.18 kernel.
Sched_ext for Linux 6.18 is bringing code cleanups, new helpers, some debugging enhancements, and a variety of other improvements.
Also standing out with this sched_ext pull is preparations for cgroup sub-scheduler support.
- Code organization cleanup. Separate internal types and accessors to ext_internal.h to reduce the size of ext.c and improve maintainability.
- Prepare for cgroup sub-scheduler support by adding @sch parameter to various functions and helpers, reorganizing scheduler instance handling, and dropping obsolete helpers like scx_kf_exit() and kf_cpu_valid().
- Add new scx_bpf_cpu_curr() and scx_bpf_locked_rq() BPF helpers to provide safer access patterns with proper RCU protection. scx_bpf_cpu_rq() is deprecated with warnings due to potential race conditions.
- Improve debugging with migration-disabled counter in error state dumps, SCX_EFLAG_INITIALIZED flag, bitfields for warning flags, and other enhancements to help diagnose issues.
- Use cgroup_lock/unlock() for cgroup synchronization instead of scx_cgroup_rwsem based synchronization. This is simpler and allows enable/disable paths to synchronize against cgroup changes independent of the CPU controller.
- rhashtable_lookup() replacement to avoid redundant RCU locking was reverted due to RCU usage warnings. Will be redone once rhashtable is updated to use rcu_dereference_all().
- Other misc updates and fixes including bypass handling improvements, scx_task_iter_relock() improvements, tools/sched_ext updates, and compatibility helpers.
More details on these sched_ext changes prepped for the Linux 6.18 merge window via [3]this pull request .
[1] https://www.phoronix.com/search/sched_ext
[2] https://www.phoronix.com/search/Linux+6.18
[3] https://lore.kernel.org/lkml/41d26de7756d571845b9feb04a4e8e9d@kernel.org/
Sched_ext for Linux 6.18 is bringing code cleanups, new helpers, some debugging enhancements, and a variety of other improvements.
Also standing out with this sched_ext pull is preparations for cgroup sub-scheduler support.
- Code organization cleanup. Separate internal types and accessors to ext_internal.h to reduce the size of ext.c and improve maintainability.
- Prepare for cgroup sub-scheduler support by adding @sch parameter to various functions and helpers, reorganizing scheduler instance handling, and dropping obsolete helpers like scx_kf_exit() and kf_cpu_valid().
- Add new scx_bpf_cpu_curr() and scx_bpf_locked_rq() BPF helpers to provide safer access patterns with proper RCU protection. scx_bpf_cpu_rq() is deprecated with warnings due to potential race conditions.
- Improve debugging with migration-disabled counter in error state dumps, SCX_EFLAG_INITIALIZED flag, bitfields for warning flags, and other enhancements to help diagnose issues.
- Use cgroup_lock/unlock() for cgroup synchronization instead of scx_cgroup_rwsem based synchronization. This is simpler and allows enable/disable paths to synchronize against cgroup changes independent of the CPU controller.
- rhashtable_lookup() replacement to avoid redundant RCU locking was reverted due to RCU usage warnings. Will be redone once rhashtable is updated to use rcu_dereference_all().
- Other misc updates and fixes including bypass handling improvements, scx_task_iter_relock() improvements, tools/sched_ext updates, and compatibility helpers.
More details on these sched_ext changes prepped for the Linux 6.18 merge window via [3]this pull request .
[1] https://www.phoronix.com/search/sched_ext
[2] https://www.phoronix.com/search/Linux+6.18
[3] https://lore.kernel.org/lkml/41d26de7756d571845b9feb04a4e8e9d@kernel.org/
Kjell