Re: [PATCH] percpu: fix unit_map[] verification in pcpu_setup_first_chunk()

From: Tejun Heo
Date: Mon Sep 28 2009 - 12:53:31 EST


Christoph Lameter wrote:
> On Tue, 29 Sep 2009, Tejun Heo wrote:
>
>> Christoph, can you please elaborate why nr_cpu_ids < NR_CPUS is
>> broken?
>
> If its just an internal number that becomes larger than NR_CPUS then
> everything is fine.
>
> But if a real cpu id (returned by smp_processor_id()) gets larger than
> NR_CPUS then we get into trouble with the parts of the kernel that index
> by cpu id.

It's a unit number. Each cpu has exactly one unit number assigned to
it but there can be holes, so unit number can legally go over both
nr_cpu_ids and NR_CPUS, so yeap, it's just an internal number used
inside percpu allocator.

Tony, the original patch should be correct. Please verify.

Thanks.

--
tejun
--
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/