Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2024084ybb; Thu, 26 Mar 2020 19:54:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsmrmeZe03jKeJQihEvogfxzPwfSWVGJDu85xs/ps1KtyHy4TNtXa8vu45LGxZWJZRIsRgf X-Received: by 2002:a9d:654c:: with SMTP id q12mr8077855otl.305.1585277641965; Thu, 26 Mar 2020 19:54:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585277641; cv=none; d=google.com; s=arc-20160816; b=lwnT88CGQ9XEpQJ4IrEVfO9pspYKW99ovYPqXCIQIdfDNA/7FWtFYxTRAy5/aGNdE+ yCTuRWfJ8J6UUMBoZiDgA3sEzR4Oge7eG2tWiPxjLCGU94uUwRZug5IbNjSzP7RAXt1B Wz5bZcUaPCheKGqmWChPv+C0qKZUYfQoWZ/Hgr3JFvN5xTRoQPorarOh0MxWDV/ESPgx p0oBTY3tAu/Ff1Ug0Y3sc8rA/JHS7lMPSV//beGh3iyMf/apO5TAPSg/GUPldAIpEOyo ZpeixSEOqIjekJDAlvSgz9JWiOJsOYK1GDS6mz97pH4osxxWhn9ZbQTX1YGznK9+INh2 jQiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=w4++N08RVpCiGlHmC7RmsL50uQ3EATHmFpjCdBVUENY=; b=h9wVwuh5Z6JgfQIUoyfqRJVz094K4LiNee+UWChw1nSLvVkccLAQAtOmz6muv0nRfJ C1yzXUmlH01zaFC9YMw0nxiRo7odgPp/Ff+1fgO63N/mhpXmwEk1mtE0f9mnt0/AQacE WQG0xjdBTn8yasJgnRK3k188yypbboBMxAXf1Xc62IJQJDgw8np14ygYNij6344PqFq4 RiVuUR2n5cHP/cKOttAwI9m1yR0UP+vdSe5iR48OLC3nYAdN/0Qj7mloTbKn2s/W14rY xDMzhqV4ey4t88amF705lwv7Xu7XuJ/snewGj8t8NIB+okwe/Vl5p2VLOG4Jil/Bevev UPbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="hU/k2AOM"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 184si1759333oif.56.2020.03.26.19.53.48; Thu, 26 Mar 2020 19:54:01 -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=@gmail.com header.s=20161025 header.b="hU/k2AOM"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727725AbgC0CxT (ORCPT + 99 others); Thu, 26 Mar 2020 22:53:19 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:46551 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726363AbgC0CxT (ORCPT ); Thu, 26 Mar 2020 22:53:19 -0400 Received: by mail-qk1-f196.google.com with SMTP id u4so9405660qkj.13; Thu, 26 Mar 2020 19:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=w4++N08RVpCiGlHmC7RmsL50uQ3EATHmFpjCdBVUENY=; b=hU/k2AOMFDZW0xf2BTOdavbWpT9pJTPn5Tt4E+qgd05wDRKScCPi5YUt4C2mnhe21M F21+rftavAYTzxByOFilILMoJbIE175BynuHXmWruxcIPbN7DOX5lP37uLkfw03+KgwX Hd6BSisFfdsCA5HA7M8BIN3ZC/NtCWP5FaZ1oxYDH4c1+/nhdFkEhy7PlRqWrzmtcwpk zOXU5VqpQRmPT/hkmdV4ORqorxMdaQ5EZC0LaPwLIBCNz1DGgckKhDKITXUsjwjQvXzv uc2lHt8V33efHdZYETB4LrqnYCrXVJfdrs30w1mBuqFvcqwvAPKZhSj+38hyZSz5uk73 KH5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=w4++N08RVpCiGlHmC7RmsL50uQ3EATHmFpjCdBVUENY=; b=foXecZ+4/IvhRbuUEZBHC5j8rbd+PHQYQVJyPe9vbLnD5vR11WjDrHoY6dsYW5IMlV qMChK6Q+8ShAxj1rnLekcMvtUbiNo8SO8m5vZxH9pgOwowRBqFaJ7SE6EhxlDFR8Bal+ WT4tTWI5E714X+cEwwQ5nWUpmaKu7jmdzvK1r9NXE8EDH5EWV1hSl56QefQzAxKjdazk 3dUPpjVXKDkdmfoLULt9/lahaDJ8WZbQMZ4jyZnvzD25D7d0B4C4ccYUSGjXEmcX8Pvz SfI/G34y1j9Be2att5FNea39Vh60D5t/LgerNKPFKKNvB3bprsSehD4VEkyVKbvzzO8J vQGg== X-Gm-Message-State: ANhLgQ0BRzmbIHB8GqE/0emA5T3ChLUK/OqbsXx9J4y5UoSZ16PX9QWt Kgs9bndYWKbodnfGyjlp+jg= X-Received: by 2002:a37:e109:: with SMTP id c9mr12347525qkm.348.1585277596566; Thu, 26 Mar 2020 19:53:16 -0700 (PDT) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id 69sm2659196qki.131.2020.03.26.19.53.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 19:53:15 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id DB83F27C0054; Thu, 26 Mar 2020 22:53:14 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 26 Mar 2020 22:53:14 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudehjedgudehudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttd ertddttddvnecuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghes ghhmrghilhdrtghomheqnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphephe dvrdduheehrdduuddurdejudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpegsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhith ihqdeiledvgeehtdeigedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgr ihhlrdgtohhmsehfihigmhgvrdhnrghmvg X-ME-Proxy: Received: from localhost (unknown [52.155.111.71]) by mail.messagingengine.com (Postfix) with ESMTPA id D982F306B4EE; Thu, 26 Mar 2020 22:53:12 -0400 (EDT) Date: Fri, 27 Mar 2020 10:53:11 +0800 From: Boqun Feng 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 Cc: linux-tip-commits@vger.kernel.org Subject: Re: [tip:smp/hotplug] cpu/hotplug: Abort disabling secondary CPUs if wakeup is pending Message-ID: <20200327025311.GA58760@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> References: <1559536263-16472-1-git-send-email-pkondeti@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas and Pavankumar, I have a question about this patch, please see below: On Wed, Jun 12, 2019 at 05:34:08AM -0700, tip-bot for Pavankumar Kondeti wrote: > 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. > From the commit message, it makes sense to add the pm_wakeup_pending() check if freeze_secondary_cpus() is used for system suspend. However, freeze_secondary_cpus() is also used in kexec path on arm64: kernel_kexec(): machine_shutdown(): disable_nonboot_cpus(): freeze_secondary_cpus() , so I wonder whether the pm_wakeup_pending() makes sense in this situation? Because IIUC, in this case we want to reboot the system regardlessly, the pm_wakeup_pending() checking seems to be inappropriate then. I'm asking this because I'm debugging a kexec failure on ARM64 guest on Hyper-V, and I got the BUG_ON() triggered: [ 108.378016] kexec_core: Starting new kernel [ 108.378018] Disabling non-boot CPUs ... [ 108.378019] Wakeup pending. Abort CPU freeze [ 108.378020] Non-boot CPUs are not disabled [ 108.378049] ------------[ cut here ]------------ [ 108.378050] kernel BUG at arch/arm64/kernel/machine_kexec.c:154! Thanks! Regards, Boqun > [ 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);