Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1121009ybc; Tue, 19 Nov 2019 15:01:13 -0800 (PST) X-Google-Smtp-Source: APXvYqwPnSCsdGhgHEEzZRFUQ5dkfwIi6HpsYWT6RtKmFP+OMu2aqRetyACT4pT/Y4kgkMVTp3Om X-Received: by 2002:a05:6000:1602:: with SMTP id u2mr27027859wrb.249.1574204472989; Tue, 19 Nov 2019 15:01:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574204472; cv=none; d=google.com; s=arc-20160816; b=FFlr9+vvpRUm4onjs4nodp28dFlpfVnm0mZ58lREHwxbo820CtXSDvsqj8qE48Ao0l AERV6BaTuSZWmW8HFjXymoCr5NBtvjfYzxroOLN3+K1Rp6fRnYOKSnKaGWmhoC6A4UoF Sf1zXouoRX8L13gd39Cbgcr5n3ZwoMcABFydcJEN6f/NYBmcgcTKHHxuqpkyzjOhHor1 VPI+smStbUnmrEuV9Rq0yMqOj2e8RCjP4hKYUqaiNAAoVrsxsseFbNSd4INYrX9Pd93A qK7wrEKLcYrBXDrvFbzo8zUq6CUP3s4OGxFLv5/Sd8SYmZlop0lx/Mk+OmmN7TjoG0is WIqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=tHYdv4NkGZ6yZ+jrwR4XXjR9kNpcvI1WI7TqHXS+k7M=; b=ZqkgpQjDfiqH4YTzVc0P1vUd9Kk6ENHU2t1oz2a/rH5D3R4tCXnG7xk/oZoMRUIMHX MJnzIUt9JYQdIw/bYyptHlnJxncccgeB9STyeCcmVuk2aPoA+/JnF/BFAdOE+MYzYmTd 21e5MZ42+2wOWYTntlH3nt4YaDJPZ3jg13y16rVmK+HwQfkSd/eIMq2GYlX6uRkym+Xs oIqUn0h2D6hgRv0M9iY6NK05Pl1sRcAV0BF7M3NsiXDsBMOiYiLDVvbhXh9sLnUpFh0h 0a7Z2VngHZI/ikh1W2wJagqJ2ZlntWlrhLelmD/VFZwxpWuZz2Wq5LQETuhqfn9yLTO9 nBrQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12si15748587edv.43.2019.11.19.15.00.47; Tue, 19 Nov 2019 15:01:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727385AbfKSW7R (ORCPT + 99 others); Tue, 19 Nov 2019 17:59:17 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:54867 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727295AbfKSW7R (ORCPT ); Tue, 19 Nov 2019 17:59:17 -0500 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iXCSl-0005Tb-IR; Tue, 19 Nov 2019 23:59:11 +0100 Date: Tue, 19 Nov 2019 23:59:10 +0100 (CET) From: Thomas Gleixner To: Qais Yousef cc: Greg Kroah-Hartman , Tony Luck , Fenghua Yu , linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/12] ia64: Replace cpu_down with freeze_secondary_cpus In-Reply-To: <20191119223234.ov323rcln4slj7br@e107158-lin.cambridge.arm.com> Message-ID: References: <20191030153837.18107-1-qais.yousef@arm.com> <20191030153837.18107-5-qais.yousef@arm.com> <20191119223234.ov323rcln4slj7br@e107158-lin.cambridge.arm.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Nov 2019, Qais Yousef wrote: > On 11/19/19 23:21, Thomas Gleixner wrote: > > On Wed, 30 Oct 2019, Qais Yousef wrote: > > > void machine_shutdown(void) > > > { > > > #ifdef CONFIG_HOTPLUG_CPU > > > - int cpu; > > > - > > > - for_each_online_cpu(cpu) { > > > - if (cpu != smp_processor_id()) > > > - cpu_down(cpu); > > > - } > > > + /* TODO: Can we use disable_nonboot_cpus()? */ > > > + freeze_secondary_cpus(smp_processor_id()); > > > > freeze_secondary_cpus() is only available for CONFIG_PM_SLEEP_SMP=y and > > disable_nonboot_cpus() is a NOOP for CONFIG_PM_SLEEP_SMP=n :) > > I thought I replied to this :-( > > My plan was to simply make freeze_secondary_cpus() available and protected by > CONFIG_SMP only instead. > > Good plan? No. freeze_secondary_cpus() is really for hibernation. Look at the exit conditions there. So you really want a seperate function which depends on CONFIG_HOTPLUG_CPU and provides an inline stub for the CONFIG_HOTPLUG_CPU=n case. But I have a hard time to see how that stuff works at all on ia64: cpu_down() might sleep, i.e. it must be called from preemptible context. smp_processor_id() is invalid from preemtible context. As this is obviously broken and ia64 is in keep compile mode only, it should just go away. Thanks, tglx