display phys_proc_id only when it is initialized
PATCH 1/1 display phys_proc_id only when it is initialized
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" <[email protected]>
arch/i386/kernel/cpu/proc.c renamed from arch/i386/kernel/cpu/proc.c.org +1 -1
@@ -88,7 +88,7 @@ static int show_cpuinfo(struct seq_fileif (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);
arch/x86_64/kernel/setup.c renamed from arch/x86_64/kernel/setup.c.org +1 -1
@@ -1132,7 +1132,7 @@ static int show_cpuinfo(struct seq_fileseq_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); }