[PATCH] display phys_proc_id only when it is initialized

From: Venkatesh Pallipadi
Date: Fri Oct 01 2004 - 18:30:38 EST



phys_proc_id gets initialized only when (smp_num_siblings > 1).
But gets printed even when (smp_num_siblings == 1). As a result we print
incorrect physical processor id in /proc/cpuinfo, when HT is disabled.

This patch fixes it.

Signed-off-by:: "Venkatesh Pallipadi" <venkatesh.pallipadi@xxxxxxxxx>

--- linux-2.6.9-rc2/arch/i386/kernel/cpu/proc.c.org 2004-08-29 22:59:21.334053528 -0700
+++ linux-2.6.9-rc2/arch/i386/kernel/cpu/proc.c 2004-08-29 22:57:55.882044208 -0700
@@ -88,7 +88,7 @@ static int show_cpuinfo(struct seq_file
if (c->x86_cache_size >= 0)
seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size);
#ifdef CONFIG_X86_HT
- if (cpu_has_ht) {
+ if (smp_num_siblings > 1) {
extern int phys_proc_id[NR_CPUS];
seq_printf(m, "physical id\t: %d\n", phys_proc_id[n]);
seq_printf(m, "siblings\t: %d\n", smp_num_siblings);
--- linux-2.6.9-rc2/arch/x86_64/kernel/setup.c.org 2004-08-29 01:08:29.690920728 -0700
+++ linux-2.6.9-rc2/arch/x86_64/kernel/setup.c 2004-08-29 23:00:26.301177024 -0700
@@ -1132,7 +1132,7 @@ static int show_cpuinfo(struct seq_file
seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size);

#ifdef CONFIG_X86_HT
- if (cpu_has_ht) {
+ if (smp_num_siblings > 1) {
seq_printf(m, "physical id\t: %d\n", phys_proc_id[c - cpu_data]);
seq_printf(m, "siblings\t: %d\n", smp_num_siblings);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/