mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cpu/hotplug: Abort disabling secondary CPUs if wakeup is pending
@ 2019-06-03  4:31 Pavankumar Kondeti
  2019-06-11  2:48 ` Pavan Kondeti
  2019-06-12 12:34 ` [tip:smp/hotplug] " tip-bot for Pavankumar Kondeti
  0 siblings, 2 replies; 8+ messages in thread
From: Pavankumar Kondeti @ 2019-06-03  4:31 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, Thomas Gleixner,
	Ingo Molnar, Josh Poimboeuf, Peter Zijlstra,
	Konrad Rzeszutek Wilk, iri Kosina, Mukesh Ojha, linux-pm,
	linux-kernel
  Cc: Pavankumar Kondeti

When "deep" suspend is enabled, all CPUs except the primary CPU
are hotplugged out. Since CPU hotplug is a costly operation,
check if we have to abort the suspend in between each CPU
hotplug. This would improve the system suspend abort latency
upon detecting a wakeup condition.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
---
 kernel/cpu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index f2ef104..784b33d 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1221,6 +1221,13 @@ int freeze_secondary_cpus(int primary)
 	for_each_online_cpu(cpu) {
 		if (cpu == primary)
 			continue;
+
+		if (pm_wakeup_pending()) {
+			pr_info("Aborting disabling non-boot CPUs..\n");
+			error = -EBUSY;
+			break;
+		}
+
 		trace_suspend_resume(TPS("CPU_OFF"), cpu, true);
 		error = _cpu_down(cpu, 1, CPUHP_OFFLINE);
 		trace_suspend_resume(TPS("CPU_OFF"), cpu, false);
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-03-30 19:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-03  4:31 [PATCH] cpu/hotplug: Abort disabling secondary CPUs if wakeup is pending Pavankumar Kondeti
2019-06-11  2:48 ` Pavan Kondeti
2019-06-12 12:34 ` [tip:smp/hotplug] " tip-bot for Pavankumar Kondeti
2020-03-27  2:53   ` Boqun Feng
2020-03-27 11:06     ` Thomas Gleixner
2020-03-28 10:48       ` [tip: smp/core] cpu/hotplug: Ignore pm_wakeup_pending() for disable_nonboot_cpus() tip-bot2 for Thomas Gleixner
2020-03-30 19:40       ` [tip:smp/hotplug] cpu/hotplug: Abort disabling secondary CPUs if wakeup is pending Qais Yousef
2020-03-30 18:32     ` Qais Yousef

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®