Re: 2.6.13-mm1

From: Alexander Nyberg
Date: Fri Sep 02 2005 - 09:33:07 EST


On Thu, Sep 01, 2005 at 03:55:42AM -0700 Andrew Morton wrote:

>
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.13/2.6.13-mm1/
>

i386-boottime-for_each_cpu-broken.patch
i386-boottime-for_each_cpu-broken-fix.patch

The SMP version of __alloc_percpu checks the cpu_possible_map
before allocating memory for a certain cpu. With the above patches
the BSP cpuid is never set in cpu_possible_map which breaks CONFIG_SMP
on uniprocessor machines (as soon as someone tries to dereference
something allocated via __alloc_percpu, which in fact is never allocated
since the cpu is not set in cpu_possible_map).

The below fixes this, I'm not entirely sure about the voyager
part, should the cpu_possible_map really be CPU_MASK_ALL to begin
with there, Zwane?

Signed-off-by: Alexander Nyberg <alexn@xxxxxxxxx>

Index: mm/arch/i386/kernel/smpboot.c
===================================================================
--- mm.orig/arch/i386/kernel/smpboot.c 2005-09-02 15:28:20.000000000 +0200
+++ mm/arch/i386/kernel/smpboot.c 2005-09-02 16:16:46.000000000 +0200
@@ -1265,6 +1265,7 @@
cpu_set(smp_processor_id(), cpu_online_map);
cpu_set(smp_processor_id(), cpu_callout_map);
cpu_set(smp_processor_id(), cpu_present_map);
+ cpu_set(smp_processor_id(), cpu_possible_map);
per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
}

Index: mm/arch/i386/mach-voyager/voyager_smp.c
===================================================================
--- mm.orig/arch/i386/mach-voyager/voyager_smp.c 2005-09-02 15:28:20.000000000 +0200
+++ mm/arch/i386/mach-voyager/voyager_smp.c 2005-09-02 16:17:29.000000000 +0200
@@ -1910,6 +1910,7 @@
{
cpu_set(smp_processor_id(), cpu_online_map);
cpu_set(smp_processor_id(), cpu_callout_map);
+ cpu_set(smp_processor_id(), cpu_possible_map);
}

int __devinit
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/