02 May, 2011

3 commits

  • Move the generic 64bit NUMA init machinery from numa_64.c to numa.c.

    * node_data[], numa_mem_info and numa_distance
    * numa_add_memblk[_to](), numa_remove_memblk[_from]()
    * numa_set_distance() and friends
    * numa_init() and all the numa_meminfo handling helpers called from it
    * dummy_numa_init()
    * memory_add_physaddr_to_nid()

    A new function x86_numa_init() is added and the content of
    numa_64.c::initmem_init() is moved into it. initmem_init() now simply
    calls x86_numa_init().

    Constants and numa_off declaration are moved from numa_{32|64}.h to
    numa.h.

    This is code reorganization and doesn't involve any functional change.

    Signed-off-by: Tejun Heo
    Cc: Ingo Molnar
    Cc: Yinghai Lu
    Cc: David Rientjes
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"

    Tejun Heo
     
  • * Kill no longer used struct bootnode.

    * Kill dangling declaration of pxm_to_nid() in numa_32.h.

    * Make setup_node_bootmem() static.

    Signed-off-by: Tejun Heo
    Cc: Ingo Molnar
    Cc: Yinghai Lu
    Cc: David Rientjes
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"

    Tejun Heo
     
  • Currently, the only meaningful user of apic->x86_32_numa_cpu_node() is
    NUMAQ which returns valid mapping only after CPU is initialized during
    SMP bringup; thus, the previous patch to set apicid -> node in
    setup_local_APIC() makes __apicid_to_node[] always contain the correct
    mapping whether custom apic->x86_32_numa_cpu_node() is used or not.

    So, there is no reason to keep separate 32bit implementation. We can
    always consult __apicid_to_node[]. Move 64bit implementation from
    numa_64.c to numa.c and remove 32bit implementation from numa_32.c.

    Signed-off-by: Tejun Heo
    Cc: Ingo Molnar
    Cc: Yinghai Lu
    Cc: David Rientjes
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"

    Tejun Heo
     

01 Feb, 2011

1 commit


28 Jan, 2011

2 commits

  • x86_32 has been managing node_to_cpumask_map explicitly from
    map_cpu_to_node() and friends in a rather ugly way. With
    previous changes, it's now possible to share the code with
    64bit.

    * When CONFIG_NUMA_EMU is disabled, numa_add/remove_cpu() are
    implemented in numa.c and shared by 32 and 64bit. CONFIG_NUMA_EMU
    versions still live in numa_64.c.

    NUMA_EMU's dependency on 64bit is planned to be removed and the
    above should go away together.

    * identify_cpu() now calls numa_add_cpu() for 32bit too. This
    makes the explicit mask management from map_cpu_to_node() unnecessary.

    * The whole x86_32 specific map_cpu_to_node() chunk is no longer
    necessary. Dropped.

    Signed-off-by: Tejun Heo
    Reviewed-by: Pekka Enberg
    Cc: eric.dumazet@gmail.com
    Cc: yinghai@kernel.org
    Cc: brgerst@gmail.com
    Cc: gorcunov@gmail.com
    Cc: shaohui.zheng@intel.com
    Cc: rientjes@google.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar
    Cc: David Rientjes
    Cc: Shaohui Zheng

    Tejun Heo
     
  • The mapping between cpu/apicid and node is done via
    apicid_to_node[] on 64bit and apicid_2_node[] +
    apic->x86_32_numa_cpu_node() on 32bit. This difference makes it
    difficult to further unify 32 and 64bit NUMA handling.

    This patch unifies it by replacing both apicid_to_node[] and
    apicid_2_node[] with __apicid_to_node[] array, which is accessed
    by two accessors - set_apicid_to_node() and numa_cpu_node(). On
    64bit, numa_cpu_node() always consults __apicid_to_node[]
    directly while 32bit goes through apic->numa_cpu_node() method
    to allow apic implementations to override it.

    srat_detect_node() for amd cpus contains workaround for broken
    NUMA configuration which assumes relationship between APIC ID,
    HT node ID and NUMA topology. Leave it to access
    __apicid_to_node[] directly as mapping through CPU might result
    in undesirable behavior change. The comment is reformatted and
    updated to note the ugliness.

    Signed-off-by: Tejun Heo
    Reviewed-by: Pekka Enberg
    Cc: eric.dumazet@gmail.com
    Cc: yinghai@kernel.org
    Cc: brgerst@gmail.com
    Cc: gorcunov@gmail.com
    Cc: shaohui.zheng@intel.com
    Cc: rientjes@google.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar
    Cc: David Rientjes

    Tejun Heo
     

19 Jan, 2011

1 commit

  • In order to be able to suppress the use of SRAT tables that
    32-bit Linux can't deal with (in one case known to lead to a
    non-bootable system, unless disabling ACPI altogether), move the
    "numa=" option handling to common code.

    Signed-off-by: Jan Beulich
    Reviewed-by: Thomas Renninger
    Cc: Tejun Heo
    Cc: Thomas Renninger
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Jan Beulich
     

03 Mar, 2009

1 commit

  • Impact: cleanup

    This patch moves set_highmem_pages_init() to arch/x86/mm/highmem_32.c.

    The declaration of the function is kept in asm/numa_32.h because
    asm/highmem.h is included only if CONFIG_HIGHMEM is enabled so we
    can't put the empty static inline function there.

    Signed-off-by: Pekka Enberg
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Pekka Enberg
     

23 Oct, 2008

2 commits