linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Pavankumar Kondeti <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: konrad.wilk@oracle.com, mojha@codeaurora.org, jkosina@suse.cz,
	mingo@kernel.org, hpa@zytor.com, rjw@rjwysocki.net,
	tglx@linutronix.de, peterz@infradead.org,
	linux-kernel@vger.kernel.org, len.brown@intel.com,
	pkondeti@codeaurora.org, jpoimboe@redhat.com, pavel@ucw.cz
Subject: [tip:smp/hotplug] cpu/hotplug: Abort disabling secondary CPUs if wakeup is pending
Date: Wed, 12 Jun 2019 05:34:08 -0700	[thread overview]
Message-ID: <tip-a66d955e910ab0e598d7a7450cbe6139f52befe7@git.kernel.org> (raw)
In-Reply-To: <1559536263-16472-1-git-send-email-pkondeti@codeaurora.org>

Commit-ID:  a66d955e910ab0e598d7a7450cbe6139f52befe7
Gitweb:     https://git.kernel.org/tip/a66d955e910ab0e598d7a7450cbe6139f52befe7
Author:     Pavankumar Kondeti <pkondeti@codeaurora.org>
AuthorDate: Mon, 3 Jun 2019 10:01:03 +0530
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 12 Jun 2019 11:03:05 +0200

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

---
 kernel/cpu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index be82cbc11a8a..0778249cd49d 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("Wakeup pending. Abort CPU freeze\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);

  parent reply	other threads:[~2019-06-12 12:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-bot for Pavankumar Kondeti [this message]
2020-03-27  2:53   ` [tip:smp/hotplug] " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-a66d955e910ab0e598d7a7450cbe6139f52befe7@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=jkosina@suse.cz \
    --cc=jpoimboe@redhat.com \
    --cc=konrad.wilk@oracle.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mojha@codeaurora.org \
    --cc=pavel@ucw.cz \
    --cc=peterz@infradead.org \
    --cc=pkondeti@codeaurora.org \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).