• Tejun Heo's avatar
    x86-32, NUMA: Replace srat_32.c with srat.c · 5acd91ab
    Tejun Heo authored
    SRAT support implementation in srat_32.c and srat.c are generally
    similar; however, there are some differences.
    
    First of all, 64bit implementation supports more types of SRAT
    entries.  64bit supports x2apic, affinity, memory and SLIT.  32bit
    only supports processor and memory.
    
    Most other differences stem from different initialization protocols
    employed by 64bit and 32bit NUMA init paths.
    
    On 64bit,
    
    * Mappings among PXM, node and apicid are directly done in each SRAT
      entry callback.
    
    * Memory affinity information is passed to numa_add_memblk() which
      takes care of all interfacing with NUMA init.
    
    * Doesn't directly initialize NUMA configurations.  All the
      information is recorded in numa_nodes_parsed and memblks.
    
    On 32bit,
    
    * Checks numa_off.
    
    * Things go through one more level of indirection via private tables
      but eventually end up initializing the same mappings.
    
    * node_start/end_pfn[] are initialized and
      memblock_x86_register_active_regions() is called for each memory
      chunk.
    
    * node_set_online() is called for each online node.
    
    * sort_node_map() is called.
    
    There are also other minor differences in sanity checking and messages
    but taking 64bit version should be good enough.
    
    This patch drops the 32bit specific implementation and makes the 64bit
    implementation common for both 32 and 64bit.
    
    The init protocol differences are dealt with in two places - the
    numa_add_memblk() shim added in the previous patch and new temporary
    numa_32.c:get_memcfg_from_srat() which wraps invocation of
    x86_acpi_numa_init().
    
    The shim numa_add_memblk() handles the folowings.
    
    * node_start/end_pfn[] initialization.
    
    * node_set_online() for memory nodes.
    
    * Invocation of memblock_x86_register_active_regions().
    
    The shim get_memcfg_from_srat() handles the followings.
    
    * numa_off check.
    
    * node_set_online() for CPU nodes.
    
    * sort_node_map() invocation.
    
    * Clearing of numa_nodes_parsed and active_ranges on failure.
    
    The shims are temporary and will be removed as the generic NUMA init
    path in 32bit is replaced with 64bit one.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Yinghai Lu <yinghai@kernel.org>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    5acd91ab
numa_32.c 13.6 KB