[PATCH] CONFIG_SMP=n fixes redux

From: Jesse Barnes <jbarnes_at_engr.sgi.com>
Date: 2004-09-01 10:44:16
Today both Christoph and Alex mentioned that they thought this patch would be 
nice to have in the tree.  It allows a generic kernel to build and run when 
CONFIG_SMP=n.  I'd still like feedback about the per-cpu stuff though, in 
particular, this

+#ifdef CONFIG_SMP
        /* Set the node_data pointer for each per-cpu struct */
        for (cpu = 0; cpu < NR_CPUS; cpu++) {
                node = node_cpuid[cpu].nid;
                per_cpu(cpu_info, cpu).node_data = mem_data[node].node_data;
        }
+#else
+       {
+               struct cpuinfo_ia64 *cpu0_cpu_info;
+               cpu = 0;
+               node = node_cpuid[cpu].nid;
+               cpu0_cpu_info = (struct cpuinfo_ia64 *)(__phys_per_cpu_start +
+                       ((char *)&per_cpu__cpu_info - __per_cpu_start));
+               cpu0_cpu_info->node_data = mem_data[node].node_data;
+       }
+#endif /* CONFIG_SMP */

is really ugly.  Maybe I should take this opportunity to convert the early 
memory allocation code to using the bootmem allocator instead of backdooring 
it via find_pernode_space()?  I think that would mean we could share more 
code between the contig and discontigmem cases, but we'd also have to be 
careful to avoid cacheline aliasing.

Thanks,
Jesse

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Received on Tue Aug 31 20:52:08 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:30 EST