From 5ada76d0563798c02c4217d61d85cfacc1279a7a Mon Sep 17 00:00:00 2001 From: Stephen Dickey Date: Fri, 11 Dec 2020 17:10:32 -0800 Subject: [PATCH] ANDROID: sched/pause: prevent wake up paused cpus When used for qos or other reasons, wake up idle cpus will wake cpus en-mass. Cpus that are paused should not be woken up like this. Update to use active_mask, so that paused cpus are ignored for general cpu wakeup operations. Bug: 161210528 Change-Id: I10721e75497a8902f8ec998ded4e2eb094770f38 Signed-off-by: Stephen Dickey --- kernel/smp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/smp.c b/kernel/smp.c index 4d17501433be..d8431d301bb2 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "smpboot.h" #include "sched/smp.h" @@ -953,7 +954,8 @@ void wake_up_all_idle_cpus(void) if (cpu == smp_processor_id()) continue; - wake_up_if_idle(cpu); + if (s2idle_state == S2IDLE_STATE_ENTER || cpu_active(cpu)) + wake_up_if_idle(cpu); } preempt_enable(); }