tree f2c5cfc616721896ad63934aa84da6d44defdf9c
parent a8ab26fe5bfeef43bdcde5182ca051ae0647607e
author Siddha, Suresh B <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:25:20 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:25:20 -0700
[PATCH] x86, x86_64: dual core proc-cpuinfo and sibling-map fix
- 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 <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
i386/kernel/cpu/proc.c | 9 ++-------
x86_64/kernel/setup.c | 11 +++--------
x86_64/kernel/smpboot.c | 2 +-
3 files changed, 6 insertions(+), 16 deletions(-)
Index: arch/i386/kernel/cpu/proc.c
===================================================================
--- 456f92b42111f83a4568b27efd863f20ffabbe3c/arch/i386/kernel/cpu/proc.c
(mode:100644 sha1:0f1125b15b76a8b6e903bcb566132b1095051cb8)
+++ f2c5cfc616721896ad63934aa84da6d44defdf9c/arch/i386/kernel/cpu/proc.c
(mode:100644 sha1:4f28eba7fb8a7ada72f1f24082c177f2a8d35dc0)
@@ -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;
}
Index: arch/x86_64/kernel/setup.c
===================================================================
--- 456f92b42111f83a4568b27efd863f20ffabbe3c/arch/x86_64/kernel/setup.c
(mode:100644 sha1:7ba443584a0c61f5c8a0f1d02af788a3f2e7a329)
+++ f2c5cfc616721896ad63934aa84da6d44defdf9c/arch/x86_64/kernel/setup.c
(mode:100644 sha1:b18c114c7648ed3190490e196d3eea2d65c277d1)
@@ -1152,6 +1152,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
@@ -1195,15 +1197,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;
}
Index: arch/x86_64/kernel/smpboot.c
===================================================================
--- 456f92b42111f83a4568b27efd863f20ffabbe3c/arch/x86_64/kernel/smpboot.c
(mode:100644 sha1:eca01e82d3c77a9c87e38fd22fb4fe144c570726)
+++ f2c5cfc616721896ad63934aa84da6d44defdf9c/arch/x86_64/kernel/smpboot.c
(mode:100644 sha1:73f7e8b9543aa55051e6a912e231db6ad6c8aa3b)
@@ -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]);
}
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html