[PATCH 0/4] sched_ext: Improve code modularization

Andrea Righi posted 4 patches 6 months, 2 weeks ago
kernel/sched/ext.c      |  7 +------
kernel/sched/ext.h      |  7 +++++++
kernel/sched/ext_idle.c | 28 +++++++++++++++++-----------
kernel/sched/ext_idle.h |  7 -------
4 files changed, 25 insertions(+), 24 deletions(-)
[PATCH 0/4] sched_ext: Improve code modularization
Posted by Andrea Righi 6 months, 2 weeks ago
Despite the unusual structure of the scheduler code, where the source code
of all scheduler classes is included in a single .c file, we should still
structure the code as if each .c file were a standalone build unit. This
means marking internal functions as static, declaring shared symbols via
proper function prototypes in a header file, etc.

This patch series is a first step toward such cleanup for the sched_ext
code. There is more work to do, but these changes are intentionally small
to minimize potential disruption to the ongoing development, laying some
groundwork for a cleaner and more maintainable code.

Andrea Righi (4):
      sched_ext: idle: Remove unnecessary ifdef in scx_bpf_cpu_node()
      sched_ext: idle: Make local functions static in ext_idle.c
      sched_ext: Make scx_rq_bypassing() inline
      sched_ext: Make scx_locked_rq() shared

 kernel/sched/ext.c      |  7 +------
 kernel/sched/ext.h      |  7 +++++++
 kernel/sched/ext_idle.c | 28 +++++++++++++++++-----------
 kernel/sched/ext_idle.h |  7 -------
 4 files changed, 25 insertions(+), 24 deletions(-)
Re: [PATCH 0/4] sched_ext: Improve code modularization
Posted by Tejun Heo 6 months, 1 week ago
On Wed, Jun 04, 2025 at 04:33:10PM +0200, Andrea Righi wrote:
> Despite the unusual structure of the scheduler code, where the source code
> of all scheduler classes is included in a single .c file, we should still
> structure the code as if each .c file were a standalone build unit. This
> means marking internal functions as static, declaring shared symbols via
> proper function prototypes in a header file, etc.
> 
> This patch series is a first step toward such cleanup for the sched_ext
> code. There is more work to do, but these changes are intentionally small
> to minimize potential disruption to the ongoing development, laying some
> groundwork for a cleaner and more maintainable code.
> 
> Andrea Righi (4):
>       sched_ext: idle: Remove unnecessary ifdef in scx_bpf_cpu_node()
>       sched_ext: idle: Make local functions static in ext_idle.c
>       sched_ext: Make scx_rq_bypassing() inline
>       sched_ext: Make scx_locked_rq() shared

Applied to sched_ext/for-6.17.

Thanks.

-- 
tejun