mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Andrew Morton <akpm@osdl.org>
Cc: Paul Jackson <pj@sgi.com>, linux-kernel@vger.kernel.org
Subject: [patch] fix smp_processor_id() use in the cache-hot autodetector
Date: Tue, 15 Nov 2005 09:42:30 +0100	[thread overview]
Message-ID: <20051115084230.GA19472@elte.hu> (raw)


this patch fixes the DEBUG_PREEMPT warnings reported by Paul Jackson.  
The reason why raw_smp_processor_id() is fine here is that we dont care 
about the _precise_ CPU ID the boot process happens on, only about the 
quad. (the reason for this whole code is that NUMAQ doesnt like being 
migrated to a non-boot quad.) So we mark whatever CPU ID we happen to be 
on, and migrate back to it once calibration has finished.

Signed-off-by: Ingo Molnar <mingo@elte.hu>

 kernel/sched.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Index: linux/kernel/sched.c
===================================================================
--- linux.orig/kernel/sched.c
+++ linux/kernel/sched.c
@@ -5480,7 +5480,7 @@ __devinit static unsigned long long meas
 
 void __devinit calibrate_migration_costs(void)
 {
-	int cpu1 = -1, cpu2 = -1, cpu, orig_cpu = smp_processor_id();
+	int cpu1 = -1, cpu2 = -1, cpu, orig_cpu = raw_smp_processor_id();
 	struct sched_domain *sd;
 	unsigned long distance, max_distance = 0;
 	unsigned long long cost;
@@ -5567,7 +5567,7 @@ void __devinit calibrate_migration_costs
 	 * Move back to the original CPU. NUMA-Q gets confused
 	 * if we migrate to another quad during bootup.
 	 */
-	if (smp_processor_id() != orig_cpu) {
+	if (raw_smp_processor_id() != orig_cpu) {
 		cpumask_t mask = cpumask_of_cpu(orig_cpu),
 			saved_mask = current->cpus_allowed;
 

                 reply	other threads:[~2005-11-15  8:42 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=20051115084230.GA19472@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pj@sgi.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

all inboxes | Powered by JetHome®