From patchwork Mon Jun 3 04:31:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Kondeti X-Patchwork-Id: 10972253 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B1A0D76 for ; Mon, 3 Jun 2019 04:31:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1D552873E for ; Mon, 3 Jun 2019 04:31:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95CFB28789; Mon, 3 Jun 2019 04:31:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46FB82873E for ; Mon, 3 Jun 2019 04:31:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726597AbfFCEbQ (ORCPT ); Mon, 3 Jun 2019 00:31:16 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:56584 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbfFCEbQ (ORCPT ); Mon, 3 Jun 2019 00:31:16 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DFA0E60A05; Mon, 3 Jun 2019 04:31:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1559536275; bh=ua7F1K+amXXB1vX6cvhC8jKC0nlsfYbYU1UwwZBJmPM=; h=From:To:Cc:Subject:Date:From; b=gJtElrekmixPnR9K5ZhDlNVmZyRCPpGq4u4CjwHrFVC0zAF1GucZKySTVJaEAVRGn Mqn8Xzfq1Sitaq50/b2GpjXfgqXZu269wFoY/mgDpC+VFHzfmHh3/y/popLRYy9D0V W3ZF51OgdklmSNjAaxY2YSHg3CwJVNYKIX7z4KhQ= Received: from codeaurora.org (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pkondeti@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4C1B26077A; Mon, 3 Jun 2019 04:31:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1559536275; bh=ua7F1K+amXXB1vX6cvhC8jKC0nlsfYbYU1UwwZBJmPM=; h=From:To:Cc:Subject:Date:From; b=gJtElrekmixPnR9K5ZhDlNVmZyRCPpGq4u4CjwHrFVC0zAF1GucZKySTVJaEAVRGn Mqn8Xzfq1Sitaq50/b2GpjXfgqXZu269wFoY/mgDpC+VFHzfmHh3/y/popLRYy9D0V W3ZF51OgdklmSNjAaxY2YSHg3CwJVNYKIX7z4KhQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4C1B26077A Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=pkondeti@codeaurora.org From: Pavankumar Kondeti 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@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Pavankumar Kondeti Subject: [PATCH] cpu/hotplug: Abort disabling secondary CPUs if wakeup is pending Date: Mon, 3 Jun 2019 10:01:03 +0530 Message-Id: <1559536263-16472-1-git-send-email-pkondeti@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);