Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5902398ybi; Wed, 12 Jun 2019 10:23:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzarFdQ8+3PUoL4RClh1Hw7o7phW2tKuOPTk/QFah8FuXGtPJjq7e5SVer7CRtD2Q35CKUR X-Received: by 2002:a17:90a:3ac2:: with SMTP id b60mr311767pjc.74.1560360197964; Wed, 12 Jun 2019 10:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560360197; cv=none; d=google.com; s=arc-20160816; b=cymxH+GMbrRh0i69UMJsrSr7uLCDItoOjYIusBo9g2ZMTk0w1KP8vj78Dmh3L0eAjW SCiX/ZHxVji0lm0iyz5zCbaHWzJctGs+bUSnXXclAQf+H66mtIZAWJNXc4w07VUnQKYP JoZ3aPa9l9NHrL/dR6xkn7EhIgWHqfUDvXKH8g37udvDZDvv3Ozc4brAnEErtBt5DiYL AaGhKLnvtTb9QagIHR3chb7YWdIiza2PsV6lh0LT4AkZCBzITdoB2GSYCsUYIKkBKbCW 4gONzOKKQ2PA6deVfQyit26p3g0W9fKHDfmLeOE/OSpOf+7nfR/l2vU5fUL1rLWgrne+ WVLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=i8E3Pjz132lVE/zyO3itgO5Jj7nZ1IpdYVG2JGHWWAE=; b=ctcEjn6d3+QgGWmGQXbdZcTwkdXNz7D07BeRY17vO3e9bZ2lyIaaTH8kRkstJTmBxQ 5Vrr0gbuIn2fk9pAPaYTj6EColg1NlFtBE1t+kIxrdXyYjKIMroGriQL633HieRtbJxi SrVLlRDaiHn+ycEOF3+e8rNBJkzJa0jTrpfmd4KRfuzxf7U9ywKB4skZxyZaJP0V2/oT IvCuXKFbcZys5no7kME3Gj5AwWEDJpCVgbuh+Iddl2jY6LpcXYAV7s1nbIXtgmBFAZ/c u6/3IO2gPobszZly3e9j5poDLuoxTjpArIC4o8fBzTfCY364E3T3ZOf6jj25NZLmwrwB t3HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=TyEyvxw2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d36si226674pla.113.2019.06.12.10.23.03; Wed, 12 Jun 2019 10:23:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=TyEyvxw2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407618AbfFLMe5 (ORCPT + 99 others); Wed, 12 Jun 2019 08:34:57 -0400 Received: from terminus.zytor.com ([198.137.202.136]:42447 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728606AbfFLMe4 (ORCPT ); Wed, 12 Jun 2019 08:34:56 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x5CCY8Vp686254 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 12 Jun 2019 05:34:09 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x5CCY8Vp686254 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1560342849; bh=i8E3Pjz132lVE/zyO3itgO5Jj7nZ1IpdYVG2JGHWWAE=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=TyEyvxw2ds5wYz0DLZh2WakXDjqXhWWBkiIPtAB8sy6OaSNJcORxqpRwSTOR59rYB Yl+m5Zn5JmVuFlgnzDGdpeZt+uIhFdYsdQIJUyDwMTLP6RkJF0XE4AoVFda8TJleqw 6R6969Jp+XEU64YQoaVoBNhNrUYCzTEBw/51YTJybTp9SwOpL5E1+p1e5CD3iNAGLE v/EqD7nOr4qhj3ZvIcj/ch01jmPn8Zi437j+QaqXuRApzMRmlUewBcb3cpCdhAfNkE NwXHRGx90oj0QsnA/OTu1sM2006fVYRkeFgXynYQyEphNfcxI1jB3pf8XrORUie1AD nuFp29VMkv9Ag== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x5CCY8Zv686251; Wed, 12 Jun 2019 05:34:08 -0700 Date: Wed, 12 Jun 2019 05:34:08 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Pavankumar Kondeti Message-ID: 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 Reply-To: tglx@linutronix.de, peterz@infradead.org, linux-kernel@vger.kernel.org, len.brown@intel.com, pkondeti@codeaurora.org, jpoimboe@redhat.com, pavel@ucw.cz, konrad.wilk@oracle.com, mojha@codeaurora.org, jkosina@suse.cz, mingo@kernel.org, hpa@zytor.com, rjw@rjwysocki.net In-Reply-To: <1559536263-16472-1-git-send-email-pkondeti@codeaurora.org> References: <1559536263-16472-1-git-send-email-pkondeti@codeaurora.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] cpu/hotplug: Abort disabling secondary CPUs if wakeup is pending Git-Commit-ID: a66d955e910ab0e598d7a7450cbe6139f52befe7 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a66d955e910ab0e598d7a7450cbe6139f52befe7 Gitweb: https://git.kernel.org/tip/a66d955e910ab0e598d7a7450cbe6139f52befe7 Author: Pavankumar Kondeti AuthorDate: Mon, 3 Jun 2019 10:01:03 +0530 Committer: Thomas Gleixner 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 Signed-off-by: Thomas Gleixner Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Pavel Machek Cc: Josh Poimboeuf Cc: Peter Zijlstra Cc: Konrad Rzeszutek Wilk Cc: iri Kosina Cc: Mukesh Ojha 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);