On Monday 23 January 2006 17:46, Eric Dumazet wrote: > > Sorry for the first version of he patch. I did one change, in order to do the > initialization only for !possible cpu > > [PATCH] x86_64 : Use a special CPUDATA_RED_ZONE to catch accesses to > per_cpu(some_object, some_not_possible_cpu) > > Because cpu_data(cpu)->data_offset may contain garbage, some buggy code may do > random things without notice. If we initialize data_offset so that the > per_cpu() data sits in an unmapped memory area, we should get page faults and > stack traces should help us find the bugs. > > Signed-off-by: Eric Dumazet With that patch sched_init gives an early exception. I don't think we can fix up all cases before 2.6.16, but it's dangerous to let it reference freed memory. I think the best course of action for this now for 2.6.16 is: - mark percpu init data not __init (this way it will still reference valid memory, although shared between all impossible CPUs) - keep the impossible CPUs per cpu data to point to the original reference version (== offset 0) For 2.6.17 all the occurrences of NR_CPUS should be audited and fixed up like you started in your earlier patch. Like the attached patch. -Andi