percpu_data blindly allocates bootmem memory to store NR_CPUS instances of cpudata, instead of allocating memory only for possible cpus. This patch saves ram, allocating num_possible_cpus() (instead of NR_CPUS) instances. This patch also makes sure a reference to per_cpu(object, not_possible_cpu) does a reference to invalid memory (NULL+small_offset). As some architectures (x86_64) are now allocating cpudata only on possible cpus, we (kernel developers on x86 machines) should make sure that x86 does a similar thing to find bugs. This is important that this patch has some exposure in -mm for some time, some places must now use : for_each_cpu(i) { ... per_cpu(xxx,i) ... instead of the traditional for (i = 0 ; i < NR_CPUS ; i++) Signed-off-by: Eric Dumazet