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=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 55F30C3A589 for ; Tue, 20 Aug 2019 11:24:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 26BC42082F for ; Tue, 20 Aug 2019 11:24:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cxR+Ok5t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26BC42082F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:Message-ID: In-Reply-To:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nmhRkElmkIumbIkgBP1i2/gitEKPlNl1RvbS+QxcZRM=; b=cxR+Ok5tzeZkCq 4yCCC4wG6mPXLNU53o3mMzSo+i3JZJLzAruyZPX174lqY4UZ4irMJI8wj3k07ZnU87WDC2+WgH4cJ oGLv6DqX3gW6K1Fuqou7FMKzhY2KqbTZb0idFBQXdkr2WNOrvSlfI++nBBsdc+fqhV+ekbxO+Qju6 27PkyIMNmbsgWJibpQE9KXFLH9RyoseVBMsa76GIWY6oAzHitURKwGvMBZ+dJmFzIh6/x6Gi09Nh5 nhI1ext8d0f7fHH8D8HK7x+2IW8jzKUWLzLmmZQPt6H2FUh4z3giAXSkrBgmUl8p+YCW97QaCPDB5 qrG50fTBQ/FTjaBbp9xA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i02FR-0005Kj-Jh; Tue, 20 Aug 2019 11:24:21 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i02FO-0005KJ-NB for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2019 11:24:20 +0000 Received: from p5de0b6c5.dip0.t-ipconnect.de ([93.224.182.197] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1i02FB-000394-HA; Tue, 20 Aug 2019 13:24:05 +0200 Date: Tue, 20 Aug 2019 13:24:03 +0200 (CEST) From: Thomas Gleixner To: Hsin-Yi Wang Subject: Re: [PATCH RFC] smp: Add cpu unstopped mask for smp_send_stop/stop_other_cpus In-Reply-To: <20190820100843.3028-1-hsinyi@chromium.org> Message-ID: References: <20190820100843.3028-1-hsinyi@chromium.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190820_042418_903834_4750B3D3 X-CRM114-Status: GOOD ( 20.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kate Stewart , Peter Zijlstra , Catalin Marinas , Mukesh Ojha , Grzegorz Halat , "H . Peter Anvin \)" , Guenter Roeck , Will Deacon , Marek Szyprowski , Rob Herring , Daniel Thompson , Anders Roxell , Yury Norov , Marc Zyngier , Russell King , Aaro Koskinen , Ingo Molnar , Viresh Kumar , Waiman Long , "Paul E . McKenney" , Wei Li , Alexey Dobriyan , Julien Thierry , Len Brown , Kees Cook , Arnd Bergmann , Rik van Riel , Stephen Boyd , Shaokun Zhang , Mike Rapoport , Borislav Petkov , Josh Poimboeuf , linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman , Marcelo Tosatti , linux-kernel@vger.kernel.org, Armijn Hemel , Jiri Kosina , Mathieu Desnoyers , Andrew Morton , Tim Chen , "David S . Miller" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 20 Aug 2019, Hsin-Yi Wang wrote: > In arm/arm64/x86, reboot IPI function uses CPU online mask to let > primary CPU know how many secondary CPUs it has to wait for in > smp_send_stop()/native_stop_other_cpus(). > > However, sometimes this would trigger unnecessary warnings, since > interrupts and tasks might fall on a CPU that has already executed > the reboot ipi function. This is fine since CPU is already in spinloop. > But warnings are generated since it finds that the CPU is marked as > offiline. The warnings are supposed to catch failures in normal hotplug > offline CPUs, and reboot isn't a regular hotplug. So instead of reusing > online masks, we should use a new mask in reboot IPI functions to do the > work. > > Take tick broadcast for example. If broadcast and smp_send_stop() > happen together, most of the time, the CPU getting earliest broadcast > is already in spinloop and thus won't do anything. If the first > broadcast arrives to CPU that hasn't already executed reboot ipi, it > would try to IPI another CPU, but the CPU is already marked as offline, > and warning comes out: > > [ 22.481523] reboot: Restarting system > [ 22.481608] WARNING: CPU: 4 PID: 0 at ... That is really the complete wrong approach. There is no valid reason that a regular reboot needs to use a shortcut homebrewn variant of stopping CPUs. The proper solution is to restrict this mechansim to emergency reboots and let the normal reboot go through the regular CPU hotplug mechanism. That avoids all that duct tape which is just bound to break tomorrow again. In case of an emergency reboot, we really do not care about any extra stuff triggered. The machine is hosed already. Thanks tglx _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel