diff options
author | Alex Chiang <achiang@hp.com> | 2007-10-19 15:20:09 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2007-10-29 14:14:54 -0400 |
commit | 113134fcbca83619be4c68d0ca66db6093777b5d (patch) | |
tree | 82efd2ce1bdd61aa1af2602be9072d1b275cf893 /arch/ia64/kernel/smpboot.c | |
parent | 172c51068499ed4a168a2b94eda9d1f160a396a1 (diff) |
[IA64] /proc/cpuinfo "physical id" field cleanups
Clean up the process for presenting the "physical id" field in
/proc/cpuinfo.
- remove global smp_num_cpucores, as it is mostly useless
- remove check_for_logical_procs(), since we do the same
functionality in identify_siblings()
- reflow logic in identify_siblings(). If an older CPU
does not implement PAL_LOGICAL_TO_PHYSICAL, we may still
be able to get useful information from SAL_PHYSICAL_ID_INFO
- in identify_siblings(), threads/cores are a property of
the CPU, not the platform
- remove useless printk's about multi-core / thread
capability in identify_siblings(), as that information
is readily available in /proc/cpuinfo, and printing for
the BSP only adds little value
- smp_num_siblings is now meaningful if any CPU in the
system supports threads, not just the BSP
- expose "physical id" field, even on CPUs that are not
multi-core / multi-threaded (as long as we have a valid
value). Now we know what sockets Madisons live in too.
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/smpboot.c')
-rw-r--r-- | arch/ia64/kernel/smpboot.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index c57dbce25c12..f0fc4d8465ad 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c | |||
@@ -142,7 +142,6 @@ DEFINE_PER_CPU_SHARED_ALIGNED(cpumask_t, cpu_sibling_map); | |||
142 | EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); | 142 | EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); |
143 | 143 | ||
144 | int smp_num_siblings = 1; | 144 | int smp_num_siblings = 1; |
145 | int smp_num_cpucores = 1; | ||
146 | 145 | ||
147 | /* which logical CPU number maps to which CPU (physical APIC ID) */ | 146 | /* which logical CPU number maps to which CPU (physical APIC ID) */ |
148 | volatile int ia64_cpu_to_sapicid[NR_CPUS]; | 147 | volatile int ia64_cpu_to_sapicid[NR_CPUS]; |
@@ -886,13 +885,17 @@ identify_siblings(struct cpuinfo_ia64 *c) | |||
886 | u16 pltid; | 885 | u16 pltid; |
887 | pal_logical_to_physical_t info; | 886 | pal_logical_to_physical_t info; |
888 | 887 | ||
889 | if (smp_num_cpucores == 1 && smp_num_siblings == 1) | ||
890 | return; | ||
891 | |||
892 | if ((status = ia64_pal_logical_to_phys(-1, &info)) != PAL_STATUS_SUCCESS) { | 888 | if ((status = ia64_pal_logical_to_phys(-1, &info)) != PAL_STATUS_SUCCESS) { |
893 | printk(KERN_ERR "ia64_pal_logical_to_phys failed with %ld\n", | 889 | if (status != PAL_STATUS_UNIMPLEMENTED) { |
894 | status); | 890 | printk(KERN_ERR |
895 | return; | 891 | "ia64_pal_logical_to_phys failed with %ld\n", |
892 | status); | ||
893 | return; | ||
894 | } | ||
895 | |||
896 | info.overview_ppid = 0; | ||
897 | info.overview_cpp = 1; | ||
898 | info.overview_tpc = 1; | ||
896 | } | 899 | } |
897 | if ((status = ia64_sal_physical_id_info(&pltid)) != PAL_STATUS_SUCCESS) { | 900 | if ((status = ia64_sal_physical_id_info(&pltid)) != PAL_STATUS_SUCCESS) { |
898 | printk(KERN_ERR "ia64_sal_pltid failed with %ld\n", status); | 901 | printk(KERN_ERR "ia64_sal_pltid failed with %ld\n", status); |
@@ -900,6 +903,10 @@ identify_siblings(struct cpuinfo_ia64 *c) | |||
900 | } | 903 | } |
901 | 904 | ||
902 | c->socket_id = (pltid << 8) | info.overview_ppid; | 905 | c->socket_id = (pltid << 8) | info.overview_ppid; |
906 | |||
907 | if (info.overview_cpp == 1 && info.overview_tpc == 1) | ||
908 | return; | ||
909 | |||
903 | c->cores_per_socket = info.overview_cpp; | 910 | c->cores_per_socket = info.overview_cpp; |
904 | c->threads_per_core = info.overview_tpc; | 911 | c->threads_per_core = info.overview_tpc; |
905 | c->num_log = info.overview_num_log; | 912 | c->num_log = info.overview_num_log; |