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.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 B73BFC33C9E for ; Fri, 17 Jan 2020 04:23:20 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 663AD20730 for ; Fri, 17 Jan 2020 04:23:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ZqPtCjnT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 663AD20730 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47zSbn4PTlzDqn5 for ; Fri, 17 Jan 2020 15:23:17 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::143; helo=mail-il1-x143.google.com; envelope-from=hsinyi@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ZqPtCjnT; dkim-atps=neutral Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47zSYh5SRvzDqmj for ; Fri, 17 Jan 2020 15:21:26 +1100 (AEDT) Received: by mail-il1-x143.google.com with SMTP id v69so20216671ili.10 for ; Thu, 16 Jan 2020 20:21:26 -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=FWD1GbOslkyuZMxfKmQroWSsMfnKIl6LmtK985cUmZesC1ATjARHX7UNz0zsV53atV bxS4CHTBdj6bc6ZPcCHlK/T/fKlCOG7OO6MyKgiyXycmFK08rly5fAKVQdLl3X4/L/TD beI2yeqB3Or5A4tmRaxIqP13aio1goDJ+IHrfACYG5QEGpp3cX+3YKh7bsiAG3Xyr57g o3d0w8vRdHbCTJCSJ5he043tA0Q1CQtkWtnuzoCB6SC6or6Z7ZAP1QI9yevpSLGwYqu+ 7LMq8xoDm6qnLuuqoyvzJXAGFo7tp6aMwXoacM1tLiDQF8TYaIbnTmeQJgBRsVY5bHOB pP6w== X-Gm-Message-State: APjAAAWvsPpslIWCqeQCl4X3UPx9pbPWxuh6kynIxR7xTcG2wzD8NmfZ ODZm0aJLg4cGiQtgADAvx/daREMWpjhCNyTIsdpCcA== 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 Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-ia64@vger.kernel.org, Linux-sh list , Peter Zijlstra , Heiko Carstens , lkml , sparclinux@vger.kernel.org, Guenter Roeck , Will Deacon , Ingo Molnar , linux-s390@vger.kernel.org, linux-csky@vger.kernel.org, Aaro Koskinen , Fenghua Yu , Linux PM , linux-xtensa@linux-xtensa.org, Stephen Boyd , Josh Poimboeuf , Thomas Gleixner , Pavankumar Kondeti , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-parisc@vger.kernel.org, Greg Kroah-Hartman , linux-mips@vger.kernel.org, James Morse , Jiri Kosina , Vitaly Kuznetsov , linuxppc-dev Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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