• Tejun Heo's avatar
    sched_ext: Add a central scheduler which makes all scheduling decisions on one CPU · 037df2a3
    Tejun Heo authored
    This patch adds a new example scheduler, scx_central, which demonstrates
    central scheduling where one CPU is responsible for making all scheduling
    decisions in the system using scx_bpf_kick_cpu(). The central CPU makes
    scheduling decisions for all CPUs in the system, queues tasks on the
    appropriate local dsq's and preempts the worker CPUs. The worker CPUs in
    turn preempt the central CPU when it needs tasks to run.
    
    Currently, every CPU depends on its own tick to expire the current task. A
    follow-up patch implementing tickless support for sched_ext will allow the
    worker CPUs to go full tickless so that they can run completely undisturbed.
    
    v3: - Kumar fixed a bug where the dispatch path could overflow the dispatch
          buffer if too many are dispatched to the fallback DSQ.
    
        - Use the new SCX_KICK_IDLE to wake up non-central CPUs.
    
        - Dropped '-p' option.
    
    v2: - Use RESIZABLE_ARRAY() instead of fixed MAX_CPUS and use SCX_BUG[_ON]()
          to simplify error handling.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Reviewed-by: default avatarDavid Vernet <dvernet@meta.com>
    Acked-by: default avatarJosh Don <joshdon@google.com>
    Acked-by: default avatarHao Luo <haoluo@google.com>
    Acked-by: default avatarBarret Rhoden <brho@google.com>
    Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>
    Cc: Julia Lawall <julia.lawall@inria.fr>
    037df2a3
Makefile 8.17 KB