Skip to content

Commit a66d955

Browse files
Pavankumar KondetiKAGA-KOKO
authored andcommitted
cpu/hotplug: Abort disabling secondary CPUs if wakeup is pending
When "deep" suspend is enabled, all CPUs except the primary CPU are frozen via CPU hotplug one by one. After all secondary CPUs are unplugged the wakeup pending condition is evaluated and if pending the suspend operation is aborted and the secondary CPUs are brought up again. CPU hotplug is a slow operation, so it makes sense to check for wakeup pending in the freezer loop before bringing down the next CPU. This improves the system suspend abort latency significantly. [ tglx: Massaged changelog and improved printk message ] Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Len Brown <len.brown@intel.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: iri Kosina <jkosina@suse.cz> Cc: Mukesh Ojha <mojha@codeaurora.org> Cc: linux-pm@vger.kernel.org Link: https://lkml.kernel.org/r/1559536263-16472-1-git-send-email-pkondeti@codeaurora.org
1 parent f560201 commit a66d955

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel/cpu.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,13 @@ int freeze_secondary_cpus(int primary)
12211221
for_each_online_cpu(cpu) {
12221222
if (cpu == primary)
12231223
continue;
1224+
1225+
if (pm_wakeup_pending()) {
1226+
pr_info("Wakeup pending. Abort CPU freeze\n");
1227+
error = -EBUSY;
1228+
break;
1229+
}
1230+
12241231
trace_suspend_resume(TPS("CPU_OFF"), cpu, true);
12251232
error = _cpu_down(cpu, 1, CPUHP_OFFLINE);
12261233
trace_suspend_resume(TPS("CPU_OFF"), cpu, false);

0 commit comments

Comments
 (0)