Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[IA64] Add interface so modules can discover whether multithreading is on.

Add is_multithreading_enabled() to check whether multi-threading
is enabled independently of which cpu is currently online

Signed-off-by: stephane eranian <eranian@hpl.hp.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>

authored by

Stephane Eranian and committed by
Tony Luck
dd562c05 fd32cb3a

+25
+24
arch/ia64/kernel/smpboot.c
··· 879 879 c->core_id = info.log1_cid; 880 880 c->thread_id = info.log1_tid; 881 881 } 882 + 883 + /* 884 + * returns non zero, if multi-threading is enabled 885 + * on at least one physical package. Due to hotplug cpu 886 + * and (maxcpus=), all threads may not necessarily be enabled 887 + * even though the processor supports multi-threading. 888 + */ 889 + int is_multithreading_enabled(void) 890 + { 891 + int i, j; 892 + 893 + for_each_present_cpu(i) { 894 + for_each_present_cpu(j) { 895 + if (j == i) 896 + continue; 897 + if ((cpu_data(j)->socket_id == cpu_data(i)->socket_id)) { 898 + if (cpu_data(j)->core_id == cpu_data(i)->core_id) 899 + return 1; 900 + } 901 + } 902 + } 903 + return 0; 904 + } 905 + EXPORT_SYMBOL_GPL(is_multithreading_enabled);
+1
include/asm-ia64/smp.h
··· 128 128 extern void lock_ipi_calllock(void); 129 129 extern void unlock_ipi_calllock(void); 130 130 extern void identify_siblings (struct cpuinfo_ia64 *); 131 + extern int is_multithreading_enabled(void); 131 132 132 133 #else 133 134