linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Hsin-Yi Wang <hsinyi@chromium.org>
Cc: linux-arm-kernel@lists.infradead.org,
	Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	"H . Peter Anvin )" <hpa@zytor.com>,
	"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
	Kate Stewart <kstewart@linuxfoundation.org>,
	"David S . Miller" <davem@davemloft.net>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Arnd Bergmann <arnd@arndb.de>, Marc Zyngier <maz@kernel.org>,
	Julien Thierry <julien.thierry.kdev@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Wei Li <liwei391@huawei.com>,
	Anders Roxell <anders.roxell@linaro.org>,
	Rob Herring <robh@kernel.org>,
	Aaro Koskinen <aaro.koskinen@nokia.com>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Tim Chen <tim.c.chen@linux.intel.com>,
	Rik van Riel <riel@surriel.com>, Waiman Long <longman@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Armijn Hemel <armijn@tjaldur.nl>,
	Grzegorz Halat <ghalat@redhat.com>,
	Len Brown <len.brown@intel.com>,
	Shaokun Zhang <zhangshaokun@hisilicon.com>,
	Mike Rapoport <rppt@linux.vnet.ibm.com>,
	Kees Cook <keescook@chromium.org>,
	Stephen Boyd <swboyd@chromium.org>,
	Guenter Roeck <groeck@chromium.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Yury Norov <ynorov@marvell.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jiri Kosina <jkosina@suse.cz>, Mukesh Ojha <mojha@codeaurora.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] smp: Add cpu unstopped mask for smp_send_stop/stop_other_cpus
Date: Tue, 20 Aug 2019 13:24:03 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1908201321200.2223@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20190820100843.3028-1-hsinyi@chromium.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



      reply	other threads:[~2019-08-20 11:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 10:08 [PATCH RFC] smp: Add cpu unstopped mask for smp_send_stop/stop_other_cpus Hsin-Yi Wang
2019-08-20 11:24 ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.1908201321200.2223@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=aaro.koskinen@nokia.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=anders.roxell@linaro.org \
    --cc=armijn@tjaldur.nl \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=daniel.thompson@linaro.org \
    --cc=davem@davemloft.net \
    --cc=ghalat@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@chromium.org \
    --cc=hpa@zytor.com \
    --cc=hsinyi@chromium.org \
    --cc=jkosina@suse.cz \
    --cc=jpoimboe@redhat.com \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=keescook@chromium.org \
    --cc=kstewart@linuxfoundation.org \
    --cc=len.brown@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=liwei391@huawei.com \
    --cc=longman@redhat.com \
    --cc=m.szyprowski@samsung.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=maz@kernel.org \
    --cc=mingo@redhat.com \
    --cc=mojha@codeaurora.org \
    --cc=mtosatti@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=riel@surriel.com \
    --cc=robh@kernel.org \
    --cc=rppt@linux.vnet.ibm.com \
    --cc=swboyd@chromium.org \
    --cc=tim.c.chen@linux.intel.com \
    --cc=viresh.kumar@linaro.org \
    --cc=will@kernel.org \
    --cc=ynorov@marvell.com \
    --cc=zhangshaokun@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).