All of lore.kernel.org
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: mark.rutland@arm.com, panand@redhat.com,
	ard.biesheuvel@linaro.org, geoff@infradead.org,
	catalin.marinas@arm.com, will.deacon@arm.com,
	james.morse@arm.com, bauerman@linux.vnet.ibm.com,
	sgoel@codeaurora.org, dyoung@redhat.com,
	kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v35 08/14] arm64: kdump: implement machine_crash_shutdown()
Date: Tue, 4 Apr 2017 16:29:23 +0900	[thread overview]
Message-ID: <20170404072922.GH16309@linaro.org> (raw)
In-Reply-To: <1491211294.6020.21.camel@infradead.org>

On Mon, Apr 03, 2017 at 10:21:34AM +0100, David Woodhouse wrote:
> On Mon, 2017-04-03 at 11:24 +0900, AKASHI Takahiro wrote:
> > 
> > +static void ipi_cpu_crash_stop(unsigned int cpu, struct pt_regs
> > *regs)
> > +{
> > +#ifdef CONFIG_KEXEC_CORE
> > +       crash_save_cpu(regs, cpu);
> > +
> > +       atomic_dec(&waiting_for_crash_ipi);
> > +
> > +       local_irq_disable();
> 
> Shouldn't the above two be the other way round? Stop handling
> interrupts *before* we tell the surviving CPU that we're done?

Might be, but I'm not sure how well such a change works.
Do you see any improvement in, say, saving failed-to-reboot cases?

> Also, should the surviving CPU be calling __cpu_die() to attempt to
> check that the others really have died? Sure, it can't do much more
> than print a warning if the call to ->cpu_kill() times out, but that's
> still useful information.

A pair of cpu_wait_death() and cpu_report_death() merely does
a hand-shake protocol over per-cpu "cpu_hotplug_state" variable.
In this sense, it's not much different from "waiting_for_crash_ipi"
approach used here in ipi_cpu_crash_stop().

Having said that, cpu_ops->cpu_kill() might help forcefully tear down
the cpu(s). One of my concerns is that we may lose some data in cache.

> And perhaps we could allow platforms to
> register a method to shoot other CPUs down forcefully if they don't
> respond. My board could apparently support that.
> 
> It would certainly be useful to allow smp_send_crash_stop() to be
> overridden with a platform-specific method instead of normal IPIs. The
> platform might be able to do something... less maskable.

I agree.
It would be great if you post your own patch for such a new interface.
(Without any hardware, I can't implement/test this feature, anyway.)

Thanks,
-Takahiro AKASHI

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

WARNING: multiple messages have this Message-ID (diff)
From: takahiro.akashi@linaro.org (AKASHI Takahiro)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v35 08/14] arm64: kdump: implement machine_crash_shutdown()
Date: Tue, 4 Apr 2017 16:29:23 +0900	[thread overview]
Message-ID: <20170404072922.GH16309@linaro.org> (raw)
In-Reply-To: <1491211294.6020.21.camel@infradead.org>

On Mon, Apr 03, 2017 at 10:21:34AM +0100, David Woodhouse wrote:
> On Mon, 2017-04-03 at 11:24 +0900, AKASHI Takahiro wrote:
> > 
> > +static void ipi_cpu_crash_stop(unsigned int cpu, struct pt_regs
> > *regs)
> > +{
> > +#ifdef CONFIG_KEXEC_CORE
> > +???????crash_save_cpu(regs, cpu);
> > +
> > +???????atomic_dec(&waiting_for_crash_ipi);
> > +
> > +???????local_irq_disable();
> 
> Shouldn't the above two be the other way round? Stop handling
> interrupts *before* we tell the surviving CPU that we're done?

Might be, but I'm not sure how well such a change works.
Do you see any improvement in, say, saving failed-to-reboot cases?

> Also, should the surviving CPU be calling __cpu_die() to attempt to
> check that the others really have died? Sure, it can't do much more
> than print a warning if the call to ->cpu_kill() times out, but that's
> still useful information.

A pair of cpu_wait_death() and cpu_report_death() merely does
a hand-shake protocol over per-cpu "cpu_hotplug_state" variable.
In this sense, it's not much different from "waiting_for_crash_ipi"
approach used here in ipi_cpu_crash_stop().

Having said that, cpu_ops->cpu_kill() might help forcefully tear down
the cpu(s). One of my concerns is that we may lose some data in cache.

> And perhaps we could allow platforms to
> register a method to shoot other CPUs down forcefully if they don't
> respond. My board could apparently support that.
> 
> It would certainly be useful to allow smp_send_crash_stop() to be
> overridden with a platform-specific method instead of normal IPIs. The
> platform might be able to do something... less maskable.

I agree.
It would be great if you post your own patch for such a new interface.
(Without any hardware, I can't implement/test this feature, anyway.)

Thanks,
-Takahiro AKASHI

  reply	other threads:[~2017-04-04  7:26 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03  2:21 [PATCH v35 00/14] arm64: add kdump support AKASHI Takahiro
2017-04-03  2:21 ` AKASHI Takahiro
2017-04-03  2:23 ` [PATCH v35 01/14] memblock: add memblock_clear_nomap() AKASHI Takahiro
2017-04-03  2:23   ` AKASHI Takahiro
2017-04-03  2:23   ` AKASHI Takahiro
2017-04-03  2:23 ` [PATCH v35 02/14] memblock: add memblock_cap_memory_range() AKASHI Takahiro
2017-04-03  2:23   ` AKASHI Takahiro
2017-04-03  2:23   ` AKASHI Takahiro
2017-04-05 17:20   ` Catalin Marinas
2017-04-05 17:20     ` Catalin Marinas
2017-04-05 17:20     ` Catalin Marinas
2017-04-03  2:24 ` [PATCH v35 03/14] arm64: limit memory regions based on DT property, usable-memory-range AKASHI Takahiro
2017-04-03  2:24   ` AKASHI Takahiro
2017-04-03  2:24 ` [PATCH v35 04/14] arm64: kdump: reserve memory for crash dump kernel AKASHI Takahiro
2017-04-03  2:24   ` AKASHI Takahiro
2017-04-03  2:24 ` [PATCH v35 05/14] arm64: mm: add set_memory_valid() AKASHI Takahiro
2017-04-03  2:24   ` AKASHI Takahiro
2017-04-03  2:24 ` [PATCH v35 06/14] arm64: kdump: protect crash dump kernel memory AKASHI Takahiro
2017-04-03  2:24   ` AKASHI Takahiro
2017-04-03  2:24 ` [PATCH v35 07/14] arm64: hibernate: preserve kdump image around hibernation AKASHI Takahiro
2017-04-03  2:24   ` AKASHI Takahiro
2017-04-03  2:24 ` [PATCH v35 08/14] arm64: kdump: implement machine_crash_shutdown() AKASHI Takahiro
2017-04-03  2:24   ` AKASHI Takahiro
2017-04-03  9:21   ` David Woodhouse
2017-04-03  9:21     ` David Woodhouse
2017-04-04  7:29     ` AKASHI Takahiro [this message]
2017-04-04  7:29       ` AKASHI Takahiro
2017-04-03  2:24 ` [PATCH v35 09/14] arm64: kdump: add VMCOREINFO's for user-space tools AKASHI Takahiro
2017-04-03  2:24   ` AKASHI Takahiro
2017-04-03  2:24 ` [PATCH v35 10/14] arm64: kdump: provide /proc/vmcore file AKASHI Takahiro
2017-04-03  2:24   ` AKASHI Takahiro
2017-04-03  2:24 ` [PATCH v35 11/14] arm64: kdump: enable kdump in defconfig AKASHI Takahiro
2017-04-03  2:24   ` AKASHI Takahiro
2017-04-03  2:24 ` [PATCH v35 12/14] Documentation: kdump: describe arm64 port AKASHI Takahiro
2017-04-03  2:24   ` AKASHI Takahiro
2017-04-03  2:26 ` [PATCH v35 13/14] Documentation: dt: chosen properties for arm64 kdump AKASHI Takahiro
2017-04-03  2:26   ` AKASHI Takahiro
2017-04-03  2:26   ` AKASHI Takahiro
2017-04-03  2:26 ` [PATCH v35 14/14] efi/libstub/arm*: Set default address and size cells values for an empty dtb AKASHI Takahiro
2017-04-03  2:26   ` AKASHI Takahiro
2017-04-03  2:26   ` AKASHI Takahiro
2017-05-22  0:25 ` [PATCH v35 00/14] arm64: add kdump support AKASHI Takahiro

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=20170404072922.GH16309@linaro.org \
    --to=takahiro.akashi@linaro.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=bauerman@linux.vnet.ibm.com \
    --cc=catalin.marinas@arm.com \
    --cc=dwmw2@infradead.org \
    --cc=dyoung@redhat.com \
    --cc=geoff@infradead.org \
    --cc=james.morse@arm.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=panand@redhat.com \
    --cc=sgoel@codeaurora.org \
    --cc=will.deacon@arm.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 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.