Re: [PATCH 13/16] x86: Unify cpu/apicid <-> NUMA node mapping between32 and 64bit

From: Tejun Heo
Date: Fri Dec 10 2010 - 15:46:12 EST


Hello, Thomas.

On 12/09/2010 10:43 PM, Thomas Gleixner wrote:
>> There are several places where using numa_cpu_node() is awkward and
>> the override doesn't matter. In those places, __apicid_to_node[] are
>> used directly.
>
> Why is it awkward? Anything outside the accessor functions or
> specialized setup code using it is awkward, inconsistent and sloppy.

There are two places which index the mapping by apicid instead of cpu.
One is acpi_fake_nodes() - this sets up the table, so it doesn't
constitute violation of accessors.

The problematic one is the nearby detection workaround in
kernel/cpu/amd.c. This is rather hacky and looks like added to deal
with early AMD NUMAs which had broken BIOS. The intel counterpart
omits this workaround and simply ignore NUMA configuration in those
cases.

I can change srat_detect_node() and nearby_node() to index by cpu but
as I have no idea what kind of broken configurations this is supposed
to deal with, I'm concerned that this may lead to different outcome by
walking the table in a different order. I can implement an apicid ->
numa node mapping function for this but this is something which is
inherently ugly, so maybe it's best to leave it ugly.

For now, how about adding a big fat comment explaining the ugliness in
amd.c?

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/