Re: [PATCH] CONFIG_SMP=n fixes redux

From: Jesse Barnes <jbarnes_at_engr.sgi.com>
Date: 2004-09-02 04:14:39
On Tuesday, August 31, 2004 5:44 pm, Jesse Barnes wrote:
> 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.

The patch I posted here was incomplete (missing numa.c file).  This new one 
fixes the CONFIG_NUMA=n case too, but has led me to conclude that the whole 
thing is a big mess.  Our CONFIG_* variables aren't named very well and 
there's a lot of confusion between actual NUMA support routines (e.g. smart 
page allocation, distance tables, etc.) and simple memory layout information 
necessary for discontig support on ia64 boxes.

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 Wed Sep 1 14:22:05 2004

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