From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55C08C33C9E for ; Fri, 17 Jan 2020 04:21:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26FC42083E for ; Fri, 17 Jan 2020 04:21:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ZqPtCjnT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729366AbgAQEVX (ORCPT ); Thu, 16 Jan 2020 23:21:23 -0500 Received: from mail-il1-f194.google.com ([209.85.166.194]:36404 "EHLO mail-il1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726370AbgAQEVX (ORCPT ); Thu, 16 Jan 2020 23:21:23 -0500 Received: by mail-il1-f194.google.com with SMTP id b15so20252758iln.3 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=IA0yD++I7tmz8fvVWzwpm67m87TAoL96Up3xy222iPEAbvUX9l22V2vWlLCUGJaj0x /Ww9zXCBLn2zWMYJIhrxIEBQoVc723eJ/wuxXeRdPVdenDqVF6ROMZEhZpNC8U/Gmbf6 pa2e4pFaNjWXHwB6fsZPxOtSzTTvXuTThYX376U0L3uI8KwxYp3NdE1D6K1LsusisBmV 2rNLkPttwO2fpxwDZRzn6ZnpO5HSOQNNXRnSfwyxSR0N9PP6SZ/ANUfmSENe6prLhiy2 UhsBDoTAX+TXqsrtnl1G7dZBlYU4qtKTi3wygMb8ia2vBuNFna8v1cyqeZugw/ae01t6 Nx6g== X-Gm-Message-State: APjAAAVt4LEKCDuiMi2uIAbc3c+CCxzRWwRvMUnAUBjtcqUOwQX1Rpkd ypRiHk1bZpVZ1cyUdt0qCDHW62A6YJbKmLpYXABLjg== X-Google-Smtp-Source: APXvYqx+51arEmX8KrYJLorNsz5cqX3rSL1q9+0np0e9Hh5Vavh2uliQ4xTj4S5fGKDgZ5Qi5GtPwcY6HIB8S7Zf6a8= 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-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@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