• Tejun Heo's avatar
    sched, sched_ext: Open code for_balance_class_range() · 744d8360
    Tejun Heo authored
    For flexibility, sched_ext allows the BPF scheduler to select the CPU to
    execute a task on at dispatch time so that e.g. a queue can be shared across
    multiple CPUs. To enable this, the dispatch path is executed from balance()
    so that a dispatched task can be hot-migrated to its target CPU. This means
    that sched_ext needs its balance() method invoked before every
    pick_next_task() even when the CPU is waking up from SCHED_IDLE.
    
    for_balance_class_range() defined in kernel/sched/ext.h implements this
    selective iteration promotion. However, the indirection obfuscates more than
    helps. Open code the iteration promotion in put_prev_task_balance() and
    remove for_balance_class_range().
    
    No functional changes intended.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    Acked-by: default avatarDavid Vernet <void@manifault.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    744d8360
core.c 268 KB