From: Andi Kleen Date: Sat, 16 Apr 2005 22:24:51 +0000 (-0700) Subject: [PATCH] x86-64/i386: Revert cpuinfo siblings behaviour back to 2.6.10 X-Git-Tag: v2.6.12-rc3~178 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=db4686812835a497d6f5de1e6cf6e8010a3fc0c7;p=~emulex%2Finfiniband.git [PATCH] x86-64/i386: Revert cpuinfo siblings behaviour back to 2.6.10 Only display physical id/siblings when there are siblings or dual core. In 2.6.11 I accidentially broke it and it was always displaying these fields But for compatibility to all these /proc parsers around it is better to do it in the old way again. Noticed by Suresh Siddha Cc: Signed-off-by: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/i386/kernel/cpu/proc.c b/arch/i386/kernel/cpu/proc.c index c8d83fdc237..89a2956ee65 100644 --- a/arch/i386/kernel/cpu/proc.c +++ b/arch/i386/kernel/cpu/proc.c @@ -94,8 +94,11 @@ static int show_cpuinfo(struct seq_file *m, void *v) if (c->x86_cache_size >= 0) seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size); #ifdef CONFIG_X86_HT - seq_printf(m, "physical id\t: %d\n", phys_proc_id[n]); - seq_printf(m, "siblings\t: %d\n", c->x86_num_cores * smp_num_siblings); + if (c->x86_num_cores * smp_num_siblings > 1) { + seq_printf(m, "physical id\t: %d\n", phys_proc_id[n]); + seq_printf(m, "siblings\t: %d\n", + c->x86_num_cores * smp_num_siblings); + } #endif /* We use exception 16 if we have hardware math and we've either seen it or the CPU claims it is internal */ diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index e50fc41de6b..a191d483178 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c @@ -1113,8 +1113,12 @@ static int show_cpuinfo(struct seq_file *m, void *v) seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size); #ifdef CONFIG_SMP - seq_printf(m, "physical id\t: %d\n", phys_proc_id[c - cpu_data]); - seq_printf(m, "siblings\t: %d\n", c->x86_num_cores * smp_num_siblings); + if (smp_num_siblings * c->x86_num_cores > 1) { + int cpu = c - cpu_data; + seq_printf(m, "physical id\t: %d\n", phys_proc_id[cpu]); + seq_printf(m, "siblings\t: %d\n", + c->x86_num_cores * smp_num_siblings); + } #endif seq_printf(m,