From 66b31cd2cbee2674176b25c2994fd3db90184c03 Mon Sep 17 00:00:00 2001 From: Stephane Eranian Date: Thu, 21 Sep 2006 10:35:44 -0700 Subject: [PATCH] --- yaml --- r: 36335 b: refs/heads/master c: dd562c05410e13e878a3ee0deb8ac06db2e132c7 h: refs/heads/master i: 36333: 5170acdb663eec4eeda4ccc9a84d23ac17ee4dd0 36331: 0542fabf993410a5de8789b6732326c345fc2a69 36327: 0b6db96c0f7b9b3555eb195c762d295325ff4481 36319: ff5e420846d20a034e2fe06e922d50b3fd0caee2 v: v3 --- [refs] | 2 +- trunk/arch/ia64/kernel/smpboot.c | 24 ++++++++++++++++++++++++ trunk/include/asm-ia64/smp.h | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index fad2370b4ce9..82999ff5b5c7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fd32cb3a9c9f9399421408e8734cd8a6d9d1a09f +refs/heads/master: dd562c05410e13e878a3ee0deb8ac06db2e132c7 diff --git a/trunk/arch/ia64/kernel/smpboot.c b/trunk/arch/ia64/kernel/smpboot.c index 6203ed4ec8cf..f7d7f5668144 100644 --- a/trunk/arch/ia64/kernel/smpboot.c +++ b/trunk/arch/ia64/kernel/smpboot.c @@ -879,3 +879,27 @@ identify_siblings(struct cpuinfo_ia64 *c) c->core_id = info.log1_cid; c->thread_id = info.log1_tid; } + +/* + * returns non zero, if multi-threading is enabled + * on at least one physical package. Due to hotplug cpu + * and (maxcpus=), all threads may not necessarily be enabled + * even though the processor supports multi-threading. + */ +int is_multithreading_enabled(void) +{ + int i, j; + + for_each_present_cpu(i) { + for_each_present_cpu(j) { + if (j == i) + continue; + if ((cpu_data(j)->socket_id == cpu_data(i)->socket_id)) { + if (cpu_data(j)->core_id == cpu_data(i)->core_id) + return 1; + } + } + } + return 0; +} +EXPORT_SYMBOL_GPL(is_multithreading_enabled); diff --git a/trunk/include/asm-ia64/smp.h b/trunk/include/asm-ia64/smp.h index 719ff309ce09..6533eb4e86ad 100644 --- a/trunk/include/asm-ia64/smp.h +++ b/trunk/include/asm-ia64/smp.h @@ -128,6 +128,7 @@ extern void smp_send_reschedule (int cpu); extern void lock_ipi_calllock(void); extern void unlock_ipi_calllock(void); extern void identify_siblings (struct cpuinfo_ia64 *); +extern int is_multithreading_enabled(void); #else