mirror of https://gitee.com/openkylin/linux.git
[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>
This commit is contained in:
parent
fd32cb3a9c
commit
dd562c0541
|
@ -879,3 +879,27 @@ identify_siblings(struct cpuinfo_ia64 *c)
|
||||||
c->core_id = info.log1_cid;
|
c->core_id = info.log1_cid;
|
||||||
c->thread_id = info.log1_tid;
|
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);
|
||||||
|
|
|
@ -128,6 +128,7 @@ extern void smp_send_reschedule (int cpu);
|
||||||
extern void lock_ipi_calllock(void);
|
extern void lock_ipi_calllock(void);
|
||||||
extern void unlock_ipi_calllock(void);
|
extern void unlock_ipi_calllock(void);
|
||||||
extern void identify_siblings (struct cpuinfo_ia64 *);
|
extern void identify_siblings (struct cpuinfo_ia64 *);
|
||||||
|
extern int is_multithreading_enabled(void);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue