tree b6add60d5b066524352d9d85a68429f9160802fb
parent c636f4a8f6899fac5d1e2c3f0be42c30d2299d63
author Siddha, Suresh B <[EMAIL PROTECTED]> Tue Apr 12 08:25:51 2005
committer Linus Torvalds <[EMAIL PROTECTED]> Tue Apr 12 08:25:51 2005

[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
===================================================================
--- a99f90ee145db6ee48fbfabd5ef992ef1626af54/arch/i386/kernel/cpu/proc.c  
(mode:100644 sha1:c92e32fecb8abbae68ec53f8334e5142c8844236)
+++ b6add60d5b066524352d9d85a68429f9160802fb/arch/i386/kernel/cpu/proc.c  
(mode:100644 sha1:a2419f9499685cbc38dd9ac81b12132860942567)
@@ -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
===================================================================
--- a99f90ee145db6ee48fbfabd5ef992ef1626af54/arch/x86_64/kernel/setup.c  
(mode:100644 sha1:f0152115876406e8d2f147263e8df22999b5b72a)
+++ b6add60d5b066524352d9d85a68429f9160802fb/arch/x86_64/kernel/setup.c  
(mode:100644 sha1:044a0beefa82b531e13460b371246ede00c3990a)
@@ -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
===================================================================
--- a99f90ee145db6ee48fbfabd5ef992ef1626af54/arch/x86_64/kernel/smpboot.c  
(mode:100644 sha1:abd32f275226352059e34658e7d41ca0cf0f551a)
+++ b6add60d5b066524352d9d85a68429f9160802fb/arch/x86_64/kernel/smpboot.c  
(mode:100644 sha1:f8d346d1ddf61889a9dbdfbcfd24ad387b1e4015)
@@ -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

Reply via email to