Don't allow the CPU marked as avoid. This is used when task is pushed out
of a CPU marked as avoid in select_fallback_rq

Signed-off-by: Shrikanth Hegde <sshe...@linux.ibm.com>
---
 kernel/sched/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 0e3a00e2a2cc..13e44d7a0b90 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2437,6 +2437,10 @@ static inline bool is_cpu_allowed(struct task_struct *p, 
int cpu)
        if (cpu_dying(cpu))
                return false;
 
+       /* CPU marked as avoid, shouldn't chosen to run any task*/
+       if (cpu_avoid(cpu))
+               return false;
+
        /* But are allowed during online. */
        return cpu_online(cpu);
 }
-- 
2.43.0


Reply via email to