• Tejun Heo's avatar
    sched_ext: Use task_can_run_on_remote_rq() test in dispatch_to_local_dsq() · 0366017e
    Tejun Heo authored
    When deciding whether a task can be migrated to a CPU,
    dispatch_to_local_dsq() was open-coding p->cpus_allowed and scx_rq_online()
    tests instead of using task_can_run_on_remote_rq(). This had two problems.
    
    - It was missing is_migration_disabled() check and thus could try to migrate
      a task which shouldn't leading to assertion and scheduling failures.
    
    - It was testing p->cpus_ptr directly instead of using task_allowed_on_cpu()
      and thus failed to consider ISA compatibility.
    
    Update dispatch_to_local_dsq() to use task_can_run_on_remote_rq():
    
    - Move scx_ops_error() triggering into task_can_run_on_remote_rq().
    
    - When migration isn't allowed, fall back to the global DSQ instead of the
      source DSQ by returning DTL_INVALID. This is both simpler and an overall
      better behavior.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Acked-by: default avatarDavid Vernet <void@manifault.com>
    0366017e
ext.c 183 KB