From: Will Deacon <will.deacon@arm.com>
To: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
Geoff Levand <geoff@infradead.org>,
Catalin Marinas <catalin.marinas@arm.com>,
kexec@lists.infradead.org, marc.zyngier@arm.com,
linux-arm-kernel@lists.infradead.org,
christoffer.dall@linaro.org
Subject: Re: [PATCH 11/15] arm64: kdump: implement machine_crash_shutdown()
Date: Tue, 10 Nov 2015 09:54:11 +0000 [thread overview]
Message-ID: <20151110095411.GB31947@arm.com> (raw)
In-Reply-To: <5641472C.9080201@linaro.org>
On Tue, Nov 10, 2015 at 10:23:56AM +0900, AKASHI Takahiro wrote:
> On 11/07/2015 04:14 AM, Geoff Levand wrote:
> >From: AKASHI Takahiro <takahiro.akashi@linaro.org>
> >
> >kdump calls machine_crash_shutdown() to shut down non-boot cpus and
> >save registers' status in per-cpu ELF notes before starting the crash
> >dump kernel. See kernel_kexec().
> >
> >ipi_cpu_stop() is a bit modified and used to support this behavior.
>
> I've got some concerns of using ipi_cpu_stop().
>
> >Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> >---
> > arch/arm64/include/asm/kexec.h | 34 +++++++++++++++++++++++++++++++++-
> > arch/arm64/kernel/machine_kexec.c | 31 +++++++++++++++++++++++++++++--
> > arch/arm64/kernel/smp.c | 16 ++++++++++++++--
> > 3 files changed, 76 insertions(+), 5 deletions(-)
[...]
> >diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> >index dbdaacd..88aec66 100644
> >--- a/arch/arm64/kernel/smp.c
> >+++ b/arch/arm64/kernel/smp.c
> >@@ -37,6 +37,7 @@
> > #include <linux/completion.h>
> > #include <linux/of.h>
> > #include <linux/irq_work.h>
> >+#include <linux/kexec.h>
> >
> > #include <asm/alternative.h>
> > #include <asm/atomic.h>
> >@@ -54,6 +55,8 @@
> > #include <asm/ptrace.h>
> > #include <asm/virt.h>
> >
> >+#include "cpu-reset.h"
> >+
> > #define CREATE_TRACE_POINTS
> > #include <trace/events/ipi.h>
> >
> >@@ -679,8 +682,12 @@ static DEFINE_RAW_SPINLOCK(stop_lock);
> > /*
> > * ipi_cpu_stop - handle IPI from smp_send_stop()
> > */
> >-static void ipi_cpu_stop(unsigned int cpu)
> >+static void ipi_cpu_stop(unsigned int cpu, struct pt_regs *regs)
> > {
> >+#ifdef CONFIG_KEXEC
> >+ /* printing messages may slow down the shutdown. */
> >+ if (!in_crash_kexec)
> >+#endif
> > if (system_state == SYSTEM_BOOTING ||
> > system_state == SYSTEM_RUNNING) {
> > raw_spin_lock(&stop_lock);
> >@@ -693,6 +700,11 @@ static void ipi_cpu_stop(unsigned int cpu)
> >
> > local_irq_disable();
> >
> >+#ifdef CONFIG_KEXEC
> >+ if (in_crash_kexec)
> >+ crash_save_cpu(regs, cpu);
> >+#endif /* CONFIG_KEXEC */
> >+
> > while (1)
> > cpu_relax();
> > }
>
> cpu_relax() is defined as asm("yield"), and this puts all but boot cpu into
> a infinite loop of nop (actually, whether nop or other depends on hw implementation).
> Thus all the secondary cpus are still running busy loop even after crash dump kernel
> has started up, and the chip can potentially get overheated.
> I ran into this situation when I tested the code on Hikey, and the system was
> forced to be shut down by thermal driver.
>
> So I'd like to modify the code a bit like:
> if (in_crash_kernel {
> crash_save_cpu(regs, cpu);
> while (1)
> asm("wfi"); /* irq is disabled here. */
> }
>
> Does this make sense?
It would be even better if we could hotplug them off.
Will
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 11/15] arm64: kdump: implement machine_crash_shutdown()
Date: Tue, 10 Nov 2015 09:54:11 +0000 [thread overview]
Message-ID: <20151110095411.GB31947@arm.com> (raw)
In-Reply-To: <5641472C.9080201@linaro.org>
On Tue, Nov 10, 2015 at 10:23:56AM +0900, AKASHI Takahiro wrote:
> On 11/07/2015 04:14 AM, Geoff Levand wrote:
> >From: AKASHI Takahiro <takahiro.akashi@linaro.org>
> >
> >kdump calls machine_crash_shutdown() to shut down non-boot cpus and
> >save registers' status in per-cpu ELF notes before starting the crash
> >dump kernel. See kernel_kexec().
> >
> >ipi_cpu_stop() is a bit modified and used to support this behavior.
>
> I've got some concerns of using ipi_cpu_stop().
>
> >Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> >---
> > arch/arm64/include/asm/kexec.h | 34 +++++++++++++++++++++++++++++++++-
> > arch/arm64/kernel/machine_kexec.c | 31 +++++++++++++++++++++++++++++--
> > arch/arm64/kernel/smp.c | 16 ++++++++++++++--
> > 3 files changed, 76 insertions(+), 5 deletions(-)
[...]
> >diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> >index dbdaacd..88aec66 100644
> >--- a/arch/arm64/kernel/smp.c
> >+++ b/arch/arm64/kernel/smp.c
> >@@ -37,6 +37,7 @@
> > #include <linux/completion.h>
> > #include <linux/of.h>
> > #include <linux/irq_work.h>
> >+#include <linux/kexec.h>
> >
> > #include <asm/alternative.h>
> > #include <asm/atomic.h>
> >@@ -54,6 +55,8 @@
> > #include <asm/ptrace.h>
> > #include <asm/virt.h>
> >
> >+#include "cpu-reset.h"
> >+
> > #define CREATE_TRACE_POINTS
> > #include <trace/events/ipi.h>
> >
> >@@ -679,8 +682,12 @@ static DEFINE_RAW_SPINLOCK(stop_lock);
> > /*
> > * ipi_cpu_stop - handle IPI from smp_send_stop()
> > */
> >-static void ipi_cpu_stop(unsigned int cpu)
> >+static void ipi_cpu_stop(unsigned int cpu, struct pt_regs *regs)
> > {
> >+#ifdef CONFIG_KEXEC
> >+ /* printing messages may slow down the shutdown. */
> >+ if (!in_crash_kexec)
> >+#endif
> > if (system_state == SYSTEM_BOOTING ||
> > system_state == SYSTEM_RUNNING) {
> > raw_spin_lock(&stop_lock);
> >@@ -693,6 +700,11 @@ static void ipi_cpu_stop(unsigned int cpu)
> >
> > local_irq_disable();
> >
> >+#ifdef CONFIG_KEXEC
> >+ if (in_crash_kexec)
> >+ crash_save_cpu(regs, cpu);
> >+#endif /* CONFIG_KEXEC */
> >+
> > while (1)
> > cpu_relax();
> > }
>
> cpu_relax() is defined as asm("yield"), and this puts all but boot cpu into
> a infinite loop of nop (actually, whether nop or other depends on hw implementation).
> Thus all the secondary cpus are still running busy loop even after crash dump kernel
> has started up, and the chip can potentially get overheated.
> I ran into this situation when I tested the code on Hikey, and the system was
> forced to be shut down by thermal driver.
>
> So I'd like to modify the code a bit like:
> if (in_crash_kernel {
> crash_save_cpu(regs, cpu);
> while (1)
> asm("wfi"); /* irq is disabled here. */
> }
>
> Does this make sense?
It would be even better if we could hotplug them off.
Will
next prev parent reply other threads:[~2015-11-10 9:54 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-06 19:14 [PATCH 00/15] arm64 kexec kernel patches v11 Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-06 19:14 ` [PATCH 09/15] arm64/kexec: Enable kexec in the arm64 defconfig Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-06 19:14 ` [PATCH 08/15] arm64/kexec: Add pr_devel output Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-06 19:14 ` [PATCH 05/15] arm64: Add back cpu_reset routines Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-06 19:14 ` [PATCH 03/15] arm64: Add new hcall HVC_CALL_FUNC Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-06 19:14 ` [PATCH 07/15] arm64/kexec: Add core kexec support Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-06 19:14 ` [PATCH 02/15] arm64: Convert hcalls to use HVC immediate value Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-06 19:14 ` [PATCH 06/15] Revert "arm64: remove dead code" Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-06 19:14 ` [PATCH 04/15] arm64: kvm: allows kvm cpu hotplug Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-06 19:14 ` [PATCH 01/15] arm64: Fold proc-macros.S into assembler.h Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-06 19:14 ` [PATCH 12/15] arm64: kdump: add kdump support Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-06 19:14 ` [PATCH 14/15] arm64: kdump: enable kdump in the arm64 defconfig Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-06 19:14 ` [PATCH 10/15] arm64: kdump: reserve memory for crash dump kernel Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-06 19:14 ` [PATCH 13/15] arm64: kdump: update a kernel doc Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-06 19:14 ` [PATCH 11/15] arm64: kdump: implement machine_crash_shutdown() Geoff Levand
2015-11-06 19:14 ` Geoff Levand
2015-11-10 1:23 ` AKASHI Takahiro
2015-11-10 1:23 ` AKASHI Takahiro
2015-11-10 9:54 ` Will Deacon [this message]
2015-11-10 9:54 ` Will Deacon
2015-11-06 19:14 ` [PATCH 15/15] arm64: kdump: relax BUG_ON() if more than one cpus are still active Geoff Levand
2015-11-06 19:14 ` Geoff Levand
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=20151110095411.GB31947@arm.com \
--to=will.deacon@arm.com \
--cc=catalin.marinas@arm.com \
--cc=christoffer.dall@linaro.org \
--cc=geoff@infradead.org \
--cc=kexec@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=marc.zyngier@arm.com \
--cc=mark.rutland@arm.com \
--cc=takahiro.akashi@linaro.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.