linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Hari Bathini <hbathini@linux.vnet.ibm.com>
To: Laurent Vivier <lvivier@redhat.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>
Cc: dgibson@redhat.com, thuth@redhat.com,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc: on crash, kexec'ed kernel needs all CPUs are online
Date: Wed, 4 Nov 2015 18:04:18 +0530	[thread overview]
Message-ID: <5639FB4A.7020508@linux.vnet.ibm.com> (raw)
In-Reply-To: <1444935658-27319-1-git-send-email-lvivier@redhat.com>

On 10/16/2015 12:30 AM, Laurent Vivier wrote:
> On kexec, all secondary offline CPUs are onlined before
> starting the new kernel, this is not done in the case of kdump.
>
> If kdump is configured and a kernel crash occurs whereas
> some secondaries CPUs are offline (SMT=off),
> the new kernel is not able to start them and displays some
> "Processor X is stuck.".
>
> Starting with POWER8, subcore logic relies on all threads of
> core being booted. So, on startup kernel tries to start all
> threads, and asks OPAL (or RTAS) to start all CPUs (including
> threads). If a CPU has been offlined by the previous kernel,
> it has not been returned to OPAL, and thus OPAL cannot restart
> it: this CPU has been lost...
>
> Signed-off-by: Laurent Vivier<lvivier@redhat.com>


Hi Laurent,

Sorry for jumping too late into this.
Are you seeing this issue even with the below patches:

pseries:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c1caae3de46a072d0855729aed6e793e536a4a55

opal/powernv:
https://github.com/open-power/skiboot/commit/9ee56b5

Thanks
Hari

> ---
>   arch/powerpc/kernel/crash.c | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
>
> diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
> index 51dbace..3ca9452 100644
> --- a/arch/powerpc/kernel/crash.c
> +++ b/arch/powerpc/kernel/crash.c
> @@ -19,6 +19,7 @@
>   #include <linux/delay.h>
>   #include <linux/irq.h>
>   #include <linux/types.h>
> +#include <linux/cpu.h>
>   
>   #include <asm/processor.h>
>   #include <asm/machdep.h>
> @@ -299,11 +300,30 @@ int crash_shutdown_unregister(crash_shutdown_t handler)
>   }
>   EXPORT_SYMBOL(crash_shutdown_unregister);
>   
> +/*
> + * The next kernel will try to start all secondary CPUs and if
> + * there are not online it will fail to start them.
> + *
> + */
> +static void wake_offline_cpus(void)
> +{
> +	int cpu = 0;
> +
> +	for_each_present_cpu(cpu) {
> +		if (!cpu_online(cpu)) {
> +			pr_info("kexec: Waking offline cpu %d.\n", cpu);
> +			cpu_up(cpu);
> +		}
> +	}
> +}
> +
>   void default_machine_crash_shutdown(struct pt_regs *regs)
>   {
>   	unsigned int i;
>   	int (*old_handler)(struct pt_regs *regs);
>   
> +	wake_offline_cpus();
> +
>   	/*
>   	 * This function is only called after the system
>   	 * has panicked or is otherwise in a critical state.

  parent reply	other threads:[~2015-11-04 12:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15 19:00 [PATCH] powerpc: on crash, kexec'ed kernel needs all CPUs are online Laurent Vivier
2015-10-16  0:27 ` kbuild test robot
2015-10-16  2:14 ` Michael Ellerman
2015-10-16  7:48   ` Laurent Vivier
2015-10-17  2:01     ` Benjamin Herrenschmidt
2015-10-16  2:29 ` David Gibson
2015-10-16  7:57   ` Laurent Vivier
2015-10-17  2:03     ` Benjamin Herrenschmidt
2015-11-04 12:34 ` Hari Bathini [this message]
2015-11-04 13:54   ` Laurent Vivier
2015-11-05  1:32     ` David Gibson
2015-11-05  6:59       ` Stewart Smith
2015-11-05 10:23       ` Hari Bathini

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=5639FB4A.7020508@linux.vnet.ibm.com \
    --to=hbathini@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=dgibson@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lvivier@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=thuth@redhat.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).