From: Vivek Goyal <vgoyal@redhat.com>
To: Baoquan He <bhe@redhat.com>
Cc: mwhitehe@redhat.com, x86@kernel.org, kexec@lists.infradead.org,
linux-kernel@vger.kernel.org, davej@fedoraproject.org,
mingo@redhat.com, holt@sgi.com, hpa@zytor.com,
rmk+kernel@arm.linux.org.uk, tglx@linutronix.de,
akpm@linux-foundation.org, chaowang@redhat.com
Subject: Re: [PATCH] x86: make reboot task only run on the appropriate processor
Date: Tue, 5 Nov 2013 15:28:56 -0500 [thread overview]
Message-ID: <20131105202855.GD4598@redhat.com> (raw)
In-Reply-To: <1383642967-12595-1-git-send-email-bhe@redhat.com>
On Tue, Nov 05, 2013 at 05:16:07PM +0800, Baoquan He wrote:
> Currently system always reboot after below message when execute "kexec -e".
>
> [ 0.572119] smpboot: Booting Node 0, Processors # 1 OK
>
So is it same problem were we reboot on non-boot cpu and sending INIT
to boot cpu in second kernel brings down the machine?
I think for x86, it makes sense to reboot on boot cpu.
Thanks
Vivek
> In commit 1b3a5d02ee070c8f9943333b9b6370f486601e0f, reboot= handling was
> moved to kerne/reboot.c. However, the code to migrate current thread to
> reboot cpu was removed. That cause this incorrect kexec behavior.
>
> Now add that code block back.
>
> Reported-by: Matthew Whitehead <mwhitehe@redhat.com>
> Reported-by: Dave Young <dyoung@redhat.com>
> Tested-by: WANG Chao <chaowang@redhat.com>
> Signed-off-by: Baoquan He <bhe@redhat.com>
> ---
> arch/x86/kernel/reboot.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
> index 7e920bf..3049de9 100644
> --- a/arch/x86/kernel/reboot.c
> +++ b/arch/x86/kernel/reboot.c
> @@ -551,6 +551,21 @@ void native_machine_shutdown(void)
> {
> /* Stop the cpus and apics */
> #ifdef CONFIG_SMP
> + /* The boot cpu is always logical cpu 0 */
> + int reboot_cpu_id = 0;
> +
> + /* See if there has been given a command line override */
> + if ((reboot_cpu != -1) && (reboot_cpu < nr_cpu_ids) &&
> + cpu_online(reboot_cpu))
> + reboot_cpu_id = reboot_cpu;
> +
> + /* Make certain the cpu I'm about to reboot on is online */
> + if (!cpu_online(reboot_cpu_id))
> + reboot_cpu_id = smp_processor_id();
> +
> + /* Make certain I only run on the appropriate processor */
> + set_cpus_allowed_ptr(current, cpumask_of(reboot_cpu_id));
> +
> /*
> * Stop all of the others. Also disable the local irq to
> * not receive the per-cpu timer interrupt which may trigger
> --
> 1.8.3.1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: Vivek Goyal <vgoyal@redhat.com>
To: Baoquan He <bhe@redhat.com>
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de,
mingo@redhat.com, hpa@zytor.com, x86@kernel.org,
akpm@linux-foundation.org, holt@sgi.com, davej@fedoraproject.org,
rmk+kernel@arm.linux.org.uk, chaowang@redhat.com,
mwhitehe@redhat.com, kexec@lists.infradead.org
Subject: Re: [PATCH] x86: make reboot task only run on the appropriate processor
Date: Tue, 5 Nov 2013 15:28:56 -0500 [thread overview]
Message-ID: <20131105202855.GD4598@redhat.com> (raw)
In-Reply-To: <1383642967-12595-1-git-send-email-bhe@redhat.com>
On Tue, Nov 05, 2013 at 05:16:07PM +0800, Baoquan He wrote:
> Currently system always reboot after below message when execute "kexec -e".
>
> [ 0.572119] smpboot: Booting Node 0, Processors # 1 OK
>
So is it same problem were we reboot on non-boot cpu and sending INIT
to boot cpu in second kernel brings down the machine?
I think for x86, it makes sense to reboot on boot cpu.
Thanks
Vivek
> In commit 1b3a5d02ee070c8f9943333b9b6370f486601e0f, reboot= handling was
> moved to kerne/reboot.c. However, the code to migrate current thread to
> reboot cpu was removed. That cause this incorrect kexec behavior.
>
> Now add that code block back.
>
> Reported-by: Matthew Whitehead <mwhitehe@redhat.com>
> Reported-by: Dave Young <dyoung@redhat.com>
> Tested-by: WANG Chao <chaowang@redhat.com>
> Signed-off-by: Baoquan He <bhe@redhat.com>
> ---
> arch/x86/kernel/reboot.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
> index 7e920bf..3049de9 100644
> --- a/arch/x86/kernel/reboot.c
> +++ b/arch/x86/kernel/reboot.c
> @@ -551,6 +551,21 @@ void native_machine_shutdown(void)
> {
> /* Stop the cpus and apics */
> #ifdef CONFIG_SMP
> + /* The boot cpu is always logical cpu 0 */
> + int reboot_cpu_id = 0;
> +
> + /* See if there has been given a command line override */
> + if ((reboot_cpu != -1) && (reboot_cpu < nr_cpu_ids) &&
> + cpu_online(reboot_cpu))
> + reboot_cpu_id = reboot_cpu;
> +
> + /* Make certain the cpu I'm about to reboot on is online */
> + if (!cpu_online(reboot_cpu_id))
> + reboot_cpu_id = smp_processor_id();
> +
> + /* Make certain I only run on the appropriate processor */
> + set_cpus_allowed_ptr(current, cpumask_of(reboot_cpu_id));
> +
> /*
> * Stop all of the others. Also disable the local irq to
> * not receive the per-cpu timer interrupt which may trigger
> --
> 1.8.3.1
next prev parent reply other threads:[~2013-11-05 20:29 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-05 9:16 [PATCH] x86: make reboot task only run on the appropriate processor Baoquan He
2013-11-05 9:16 ` Baoquan He
2013-11-05 20:28 ` Vivek Goyal [this message]
2013-11-05 20:28 ` Vivek Goyal
2013-11-05 21:39 ` H. Peter Anvin
2013-11-05 21:39 ` H. Peter Anvin
2013-11-06 9:48 ` Baoquan He
2013-11-06 9:48 ` Baoquan He
2013-11-07 2:20 ` Baoquan He
2013-11-07 2:20 ` Baoquan He
2013-11-08 1:33 ` Dave Young
2013-11-08 1:33 ` Dave Young
2013-11-08 15:14 ` Vivek Goyal
2013-11-08 15:14 ` Vivek Goyal
2013-11-08 16:12 ` H. Peter Anvin
2013-11-08 16:12 ` H. Peter Anvin
2013-11-08 16:24 ` Vivek Goyal
2013-11-08 16:24 ` Vivek Goyal
2013-11-11 15:29 ` Vivek Goyal
2013-11-11 15:29 ` Vivek Goyal
2013-11-11 15:39 ` H. Peter Anvin
2013-11-11 15:39 ` H. Peter Anvin
2013-11-11 15:57 ` Vivek Goyal
2013-11-11 15:57 ` Vivek Goyal
2013-11-11 16:02 ` H. Peter Anvin
2013-11-11 16:02 ` H. Peter Anvin
2013-11-10 9:44 ` Baoquan He
2013-11-10 9:44 ` Baoquan He
2013-11-11 6:52 ` Baoquan He
2013-11-11 6:52 ` Baoquan He
2013-11-11 6:55 ` WANG Chao
2013-11-11 6:55 ` WANG Chao
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=20131105202855.GD4598@redhat.com \
--to=vgoyal@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=chaowang@redhat.com \
--cc=davej@fedoraproject.org \
--cc=holt@sgi.com \
--cc=hpa@zytor.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mwhitehe@redhat.com \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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.