[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8736cgxmxi.fsf@nanos.tec.linutronix.de>
Date: Thu, 16 Jan 2020 01:30:33 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Hsin-Yi Wang <hsinyi@...omium.org>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Jiri Kosina <jkosina@...e.cz>,
Pavankumar Kondeti <pkondeti@...eaurora.org>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Aaro Koskinen <aaro.koskinen@...ia.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Will Deacon <will@...nel.org>,
Fenghua Yu <fenghua.yu@...el.com>,
James Morse <james.morse@....com>,
Mark Rutland <mark.rutland@....com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Guenter Roeck <groeck@...omium.org>,
Stephen Boyd <swboyd@...omium.org>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-csky@...r.kernel.org, linux-ia64@...r.kernel.org,
linux-mips@...r.kernel.org, linux-parisc@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-s390@...r.kernel.org,
linux-sh@...r.kernel.org, sparclinux@...r.kernel.org,
linux-xtensa@...ux-xtensa.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH v5] reboot: support offline CPUs before reboot
Hsin-Yi Wang <hsinyi@...omium.org> writes:
> Currently system reboots uses architecture specific codes (smp_send_stop)
> to offline non reboot CPUs. Most architecture's implementation is looping
> through all non reboot online CPUs and call ipi function to each of them. Some
> architecture like arm64, arm, and x86... would set offline masks to cpu without
> really offline them. This causes some race condition and kernel warning comes
> out sometimes when system reboots.
'some race condition and kernel warning' is pretty useless information.
Please describe exactly which kind of issues are caused by the current
mechanism. Especially the race conditions are the interesting part (the
warnings are just a consequence).
> This patch adds a config ARCH_OFFLINE_CPUS_ON_REBOOT, which would
> offline cpus in
Please read Documentation/process/submitting-patches.rst and search for
'This patch'.
> migrate_to_reboot_cpu(). If non reboot cpus are all offlined here, the loop for
> checking online cpus would be an empty loop.
This does not make any sense. The issues which you are trying to solve
are going to be still there when CONFIG_HOTPLUG_CPU is disabled.
> If architecture don't enable this config, or some cpus somehow fails
> to offline, it would fallback to ipi function.
This is really a half baken solution which keeps the various pointlessly
different pseudo reboot/kexec offlining implementations around. So with
this we have yet more code which only works depending on kernel
configuration and has the issue of potentially not being able to offline
a CPU. IOW this is going to fail completely in cases where a system is
in a state which prevents regular hotplug.
The existing pseudo-offline functions have timeouts and eventually a
fallback, e.g. the NMI fallback on x86. With this proposed regular
offline solution this will just get stuck w/o a chance to force
recovery.
While I like the idea and surely agree that the ideal solution is to
properly shutdown the CPUs on reboot, we need to take a step back and
look at the minimum requirements for a regular shutdown/reboot and at
the same time have a look at the requirements for emergency shutdown and
kexec/kcrash. Having proper information about the race conditions and
warnings you mentioned would be a good starting point.
> Opt in this config for architectures that support CONFIG_HOTPLUG_CPU.
This is not opt-in. You force that on all architectures which support
CONFIG_HOTPLUG_CPU. The way we do this normally is to provide the
infrastructure first and then have separate patches (one per
architecture) enabling this, which allows the architecture maintainers
to decide individually.
Thanks,
tglx
Powered by blists - more mailing lists