Skip to content
  • Rohit Jain's avatar
    sched/core: Distinguish between idle_cpu() calls based on desired effect,... · 943d355d
    Rohit Jain authored
    sched/core: Distinguish between idle_cpu() calls based on desired effect, introduce available_idle_cpu()
    
    In the following commit:
    
      247f2f6f
    
     ("sched/core: Don't schedule threads on pre-empted vCPUs")
    
    ... we distinguish between idle_cpu() when the vCPU is not running for
    scheduling threads.
    
    However, the idle_cpu() function is used in other places for
    actually checking whether the state of the CPU is idle or not.
    
    Hence split the use of that function based on the desired return value,
    by introducing the available_idle_cpu() function.
    
    This fixes a (slight) regression in that initial vCPU commit, because
    some code paths (like the load-balancer) don't care and shouldn't care
    if the vCPU is preempted or not, they just want to know if there's any
    tasks on the CPU.
    
    Signed-off-by: default avatarRohit Jain <rohit.k.jain@oracle.com>
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc...
    943d355d