From: Benjamin LaHaise <bcrl@kvack.org>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 5/9] x86-64 fix smp boot failure with thread_info change
Date: Tue, 29 Nov 2005 23:21:48 -0500 [thread overview]
Message-ID: <20051130042148.GF19112@kvack.org> (raw)
Make sure that stack_smp_processor_id() gets set for all CPUs regardless of
which path we take in do_boot_cpu(), as well as in upcoming case where
tsk->thread_info != task_thread_info(tsk).
Add a memory barrier to ensure this change is flushed before the other
CPU comes up. My P4/HT machine was occasionally randomly failing to boot
without this barrier.
---
arch/x86_64/kernel/smpboot.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
applies-to: ff25c960b7af25819aba4fbecbd94bd3500a3a4a
932262b117ba1c3a77078b64674e1a1823c169df
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index 50d018a..10b951b 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -780,6 +780,9 @@ do_rest:
cpu_pda[cpu].pcurrent = c_idle.idle;
+ /* set the CPU for stack_smp_processor_id() */
+ c_idle.idle->thread_info->cpu = cpu;
+
start_rip = setup_trampoline();
init_rsp = c_idle.idle->thread.rsp;
@@ -796,6 +799,7 @@ do_rest:
* the targeted processor.
*/
+ mb();
atomic_set(&init_deasserted, 0);
Dprintk("Setting warm reset code and vector.\n");
---
0.99.9.GIT
reply other threads:[~2005-11-30 4:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20051130042148.GF19112@kvack.org \
--to=bcrl@kvack.org \
--cc=ak@suse.de \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox