linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] x86, x86_64: dual core proc-cpuinfo and sibling-map fix
@ 2005-04-12  5:42 Siddha, Suresh B
  2005-04-12 15:49 ` Andi Kleen
  0 siblings, 1 reply; 2+ messages in thread
From: Siddha, Suresh B @ 2005-04-12  5:42 UTC (permalink / raw)
  To: ak, akpm; +Cc: discuss, linux-kernel

Appended patch fixes

- broken sibling_map setup in x86_64

- grouping all the core and HT related cpuinfo fields.
  We are reasonably sure that adding new cpuinfo fields after "siblings" field,
  will not cause any app failure. Thats because today's /proc/cpuinfo
  format is completely different on x86, x86_64 and we haven't heard of any
  x86 app breakage because of this issue. Grouping these fields will 
  result in more or less common format on all architectures (ia64, x86 and 
  x86_64) and will cause less confusion.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>

diff -Nru linux-2.6.12-rc2-mm3/arch/i386/kernel/cpu/proc.c linux-mc/arch/i386/kernel/cpu/proc.c
--- linux-2.6.12-rc2-mm3/arch/i386/kernel/cpu/proc.c	2005-04-11 17:12:16.939435632 -0700
+++ linux-mc/arch/i386/kernel/cpu/proc.c	2005-04-11 17:13:31.757061624 -0700
@@ -98,6 +98,8 @@
 		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);
+		seq_printf(m, "core id\t\t: %d\n", cpu_core_id[n]);
+		seq_printf(m, "cpu cores\t: %d\n", c->x86_num_cores);
 	}
 #endif
 	
@@ -130,13 +132,6 @@
 		     c->loops_per_jiffy/(500000/HZ),
 		     (c->loops_per_jiffy/(5000/HZ)) % 100);
 
-#ifdef CONFIG_SMP
-	/* Put new fields at the end to lower the probability of
-	   breaking user space parsers. */
-	seq_printf(m, "core id\t\t: %d\n", cpu_core_id[n]);
-	seq_printf(m, "cpu cores\t: %d\n", c->x86_num_cores);
-#endif
-
 	return 0;
 }
 
diff -Nru linux-2.6.12-rc2-mm3/arch/x86_64/kernel/setup.c linux-mc/arch/x86_64/kernel/setup.c
--- linux-2.6.12-rc2-mm3/arch/x86_64/kernel/setup.c	2005-04-11 17:12:17.074415112 -0700
+++ linux-mc/arch/x86_64/kernel/setup.c	2005-04-11 17:14:34.250561168 -0700
@@ -1179,6 +1179,8 @@
 		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);
+		seq_printf(m, "core id\t\t: %d\n", cpu_core_id[cpu]);
+		seq_printf(m, "cpu cores\t: %d\n", c->x86_num_cores);
 	}
 #endif	
 
@@ -1222,15 +1224,8 @@
 			}
 	}
 
-	seq_printf(m, "\n");
+	seq_printf(m, "\n\n");
 
-#ifdef CONFIG_SMP
-	/* Put new fields at the end to lower the probability of
-	   breaking user space parsers. */
-	seq_printf(m, "core id\t\t: %d\n", cpu_core_id[c - cpu_data]);
-	seq_printf(m, "cpu cores\t: %d\n", c->x86_num_cores);
-#endif
-	seq_printf(m, "\n");
 	return 0;
 }
 
diff -Nru linux-2.6.12-rc2-mm3/arch/x86_64/kernel/smpboot.c linux-mc/arch/x86_64/kernel/smpboot.c
--- linux-2.6.12-rc2-mm3/arch/x86_64/kernel/smpboot.c	2005-04-11 17:12:17.076414808 -0700
+++ linux-mc/arch/x86_64/kernel/smpboot.c	2005-04-11 17:41:52.704478312 -0700
@@ -652,7 +652,7 @@
 		int i;
 		if (smp_num_siblings > 1) {
 			for_each_online_cpu (i) {
-				if (cpu_core_id[cpu] == phys_proc_id[i]) {
+				if (cpu_core_id[cpu] == cpu_core_id[i]) {
 					siblings++;
 					cpu_set(i, cpu_sibling_map[cpu]);
 				}

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] x86, x86_64: dual core proc-cpuinfo and sibling-map fix
  2005-04-12  5:42 [patch] x86, x86_64: dual core proc-cpuinfo and sibling-map fix Siddha, Suresh B
@ 2005-04-12 15:49 ` Andi Kleen
  0 siblings, 0 replies; 2+ messages in thread
From: Andi Kleen @ 2005-04-12 15:49 UTC (permalink / raw)
  To: Siddha, Suresh B; +Cc: akpm, discuss, linux-kernel

On Mon, Apr 11, 2005 at 10:42:29PM -0700, Siddha, Suresh B wrote:
> Appended patch fixes
> 
> - broken sibling_map setup in x86_64
> 
> - grouping all the core and HT related cpuinfo fields.
>   We are reasonably sure that adding new cpuinfo fields after "siblings" field,
>   will not cause any app failure. Thats because today's /proc/cpuinfo
>   format is completely different on x86, x86_64 and we haven't heard of any
>   x86 app breakage because of this issue. Grouping these fields will 
>   result in more or less common format on all architectures (ia64, x86 and 
>   x86_64) and will cause less confusion.

Ok from my side.

Andrew, please include that one in the batch going to Linus if there
is still enough time.

-Andi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-12 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-12  5:42 [patch] x86, x86_64: dual core proc-cpuinfo and sibling-map fix Siddha, Suresh B
2005-04-12 15:49 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).