Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8594447ybl; Thu, 16 Jan 2020 20:28:03 -0800 (PST) X-Google-Smtp-Source: APXvYqyGK/V/jYt7Qg3JZbky+pu+c5I0xNDsnnQ2wP/Pv/i+6peH/xdmh6rTa+iGyh+ZELR37cis X-Received: by 2002:a05:6808:1c5:: with SMTP id x5mr2117146oic.57.1579235283451; Thu, 16 Jan 2020 20:28:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579235283; cv=none; d=google.com; s=arc-20160816; b=cFtT5lZUDAK68VSZ6iGoBEa+WVlNbjgsWVuQjYPdrF8hdvm+uWQInBRDk+5e6HDCtm mKan1TCabbf3t1F2TxP0tP3Z1fLzTRL544wn+Hyd9wbvVRNQqFX8GzO98Y2eTcSSiKZF wJapkIlqsm1oS0xSZw9kY3ipCUNviVLva+yzgeNHqAqT6xVQmkWSOne9Ei5ofB4ZYpc2 ehNqPBtoKwFxs+fw5yXmGct7mSgTn507ac3Ur3Xi+c3CJG2K/QuGlHv7CYTLuQc+nBvl 9zY05XVKhzEiDmC8vw82lckW6kvRfijZMHQnoQetSARTvdss5ir5QVZbbBhp5xTofcAe 3SVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qfpdnB0mDY3WUkUnXeznDzcUOnDJRLF4NNorY2l78Ps=; b=jujmkLTgKt/dDu/By/gEaKrjuJj1B1nNe0MWP9BGm23l60YIJVLupkMfIlz5h5v7Pw Vjb/3rD5tNPVB4v5XC3VPhF4Y3iv8w8V30dJJC9z50tIFTHm31UVj1tezlDuuOOkHBJ3 rfM6Wtg3kISzFRQTg0L5hX3MjGsyjVGFg6J4ynG8p7ZGgXqInCNPpMWRtcHm17/UfjZj 9z+lSG5YbVLEAf02Lj8XdK1Ii6ebEWjJQZ6ZNm8Kw30BFoW8RmEPKWeeyMKsgE/+5Ez8 jLBK3GfuOSpkxLGQ3mYj5gK2DfREKq033WpeMor8JbZt/IBmVPMRjHsPeT2D0K9pPcYE fjvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZqPtCjnT; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h128si12740082oif.258.2020.01.16.20.27.51; Thu, 16 Jan 2020 20:28:03 -0800 (PST) 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=@chromium.org header.s=google header.b=ZqPtCjnT; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729030AbgAQEVY (ORCPT + 99 others); Thu, 16 Jan 2020 23:21:24 -0500 Received: from mail-il1-f194.google.com ([209.85.166.194]:46670 "EHLO mail-il1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727040AbgAQEVX (ORCPT ); Thu, 16 Jan 2020 23:21:23 -0500 Received: by mail-il1-f194.google.com with SMTP id t17so20207539ilm.13 for ; Thu, 16 Jan 2020 20:21:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qfpdnB0mDY3WUkUnXeznDzcUOnDJRLF4NNorY2l78Ps=; b=ZqPtCjnTL5BpE5R5EYfpzHPeea5Qp7vGjfHVQtwYh6GS2G1E6qCQktHCtcgcj750RB KbbeLBevioO95S1auUbZ5BvudJZBXmK4sZWDFvDOzsSReMywkA736vs8L2yTMRHJL3WU YtEnCvSIJYSnrMDfuobFoVMMr2wwZ08zgjuVc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qfpdnB0mDY3WUkUnXeznDzcUOnDJRLF4NNorY2l78Ps=; b=KB5ERtHF1FR74v6LI9NRHmGVRAp65Bmxo9e+/CKUz5KUx6L1IYv93rzrP8H9Dfzega iBWW2rJYHQaww1E2YV+bab1JCFDMQhQQyRttq1CJRikWs038d37gZYzCmhaEvVaccGaY hAEzGJfo5K9tswAXEp99VdyhN3gYK3FDERLFzxRfI5xIYl2+rMYTh8Rh4Q7KwqVWyIWL 31dUi/gC35VRgErFgfppdoAYFdmhsnUeFZ6jnyfnKMzMaFNdfYraTa/gzI+6xA9hKjxE 7SLP3xPNCyrIoHDbF9rPJDRfEpm0wyL6ug7KMXtjQ/ZADiqshc54hcWXAUbLLVWhqtDX 9SEw== X-Gm-Message-State: APjAAAWbSyJPMOZxGQLeXXowJgLqU0ojYKQEmGZ5WEXyTqMumOhgl5N1 767HGmWLG6kNiTo89MZGKUa8wHveJUchwmiyFOQ11g== X-Received: by 2002:a92:5c8f:: with SMTP id d15mr1631366ilg.102.1579234882781; Thu, 16 Jan 2020 20:21:22 -0800 (PST) MIME-Version: 1.0 References: <20200114110620.164861-1-hsinyi@chromium.org> In-Reply-To: From: Hsin-Yi Wang Date: Fri, 17 Jan 2020 12:20:56 +0800 Message-ID: Subject: Re: [PATCH RESEND v4] reboot: support offline CPUs before reboot To: Rob Landley Cc: Thomas Gleixner , Josh Poimboeuf , Ingo Molnar , Peter Zijlstra , Jiri Kosina , Pavankumar Kondeti , Vitaly Kuznetsov , Aaro Koskinen , Greg Kroah-Hartman , Will Deacon , Fenghua Yu , James Morse , Mark Rutland , Heiko Carstens , Guenter Roeck , Stephen Boyd , lkml , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-csky@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev , linux-s390@vger.kernel.org, Linux-sh list , sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, Linux PM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 17, 2020 at 12:16 PM Rob Landley wrote: > > On 1/14/20 5:06 AM, Hsin-Yi Wang wrote: > > This patch adds a config ARCH_OFFLINE_CPUS_ON_REBOOT, which would offline cpus in > > migrate_to_reboot_cpu(). If non reboot cpus are all offlined here, the loop for > > checking online cpus would be an empty loop. If architecture don't enable this > > config, or some cpus somehow fails to offline, it would fallback to ipi > > function. > > I'm curious: > > > +# Select to do a full offline on secondary CPUs before reboot. > > +config ARCH_OFFLINE_CPUS_ON_REBOOT > > + bool "Support for offline CPUs before reboot" > > + depends on HOTPLUG_CPU > > The new symbol can't be selected without the other symbol. > > > + select ARCH_OFFLINE_CPUS_ON_REBOOT if HOTPLUG_CPU > > And the other symbol automatically selects the new one. > > Why are you adding a second symbol that means the same thing as the existing symbol? > I should make the arch selecting this symbol in other patches and let the arch decides if they want to opt in, as Thomas pointed out in v5: https://lore.kernel.org/lkml/8736cgxmxi.fsf@nanos.tec.linutronix.de/ Current solution is not sufficient since it only solve problems for system that enables HOTPLUG_CPU. > > +#if defined(CONFIG_PM_SLEEP_SMP) || defined(CONFIG_ARCH_OFFLINE_CPUS_ON_REBOOT) > > +extern int freeze_secondary_cpus(int primary, bool reboot); > > +#endif > > Couldn't that just test HOTPLUG_CPU? What's the second symbol for? (You can have > empty stub functions when architectures don't support a thing...) > > Rob