summaryrefslogtreecommitdiffstats
path: root/include/linux/smp.h
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2008-01-30 13:33:17 +0100
committerIngo Molnar <mingo@elte.hu>2008-01-30 13:33:17 +0100
commitca74a6f84e68b44867022f4a4f3ec17c087c864e (patch)
treea5e84b251b1574b09288fb2636b4e4ea088ae70e /include/linux/smp.h
parent751752789162fde69474edfa15935d0a77c0bc17 (diff)
downloadblackbird-op-linux-ca74a6f84e68b44867022f4a4f3ec17c087c864e.tar.gz
blackbird-op-linux-ca74a6f84e68b44867022f4a4f3ec17c087c864e.zip
x86: optimize lock prefix switching to run less frequently
On VMs implemented using JITs that cache translated code changing the lock prefixes is a quite costly operation that forces the JIT to throw away and retranslate a lot of code. Previously a SMP kernel would rewrite the locks once for each CPU which is quite unnecessary. This patch changes the code to never switch at boot in the normal case (SMP kernel booting with >1 CPU) or only once for SMP kernel on UP. This makes a significant difference in boot up performance on AMD SimNow! Also I expect it to be a little faster on native systems too because a smp switch does a lot of text_poke()s which each synchronize the pipeline. v1->v2: Rename max_cpus v1->v2: Fix off by one in UP check (Thomas Gleixner) Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/smp.h')
-rw-r--r--include/linux/smp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/smp.h b/include/linux/smp.h
index c25e66bcecf3..55232ccf9cfd 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -78,6 +78,8 @@ int on_each_cpu(void (*func) (void *info), void *info, int retry, int wait);
*/
void smp_prepare_boot_cpu(void);
+extern unsigned int setup_max_cpus;
+
#else /* !SMP */
/*
OpenPOWER on IntegriCloud