Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86: Support Generic Initiator only proximity domains

In common with memoryless domains only register GI domains
if the proximity node is not online. If a domain is already
a memory containing domain, or a memoryless domain there is
nothing to do just because it also contains a Generic Initiator.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Jonathan Cameron and committed by
Rafael J. Wysocki
73bf7382 894c26a1

+24
+2
arch/x86/include/asm/numa.h
··· 62 62 extern void __init init_cpu_to_node(void); 63 63 extern void numa_add_cpu(int cpu); 64 64 extern void numa_remove_cpu(int cpu); 65 + extern void init_gi_nodes(void); 65 66 #else /* CONFIG_NUMA */ 66 67 static inline void numa_set_node(int cpu, int node) { } 67 68 static inline void numa_clear_node(int cpu) { } 68 69 static inline void init_cpu_to_node(void) { } 69 70 static inline void numa_add_cpu(int cpu) { } 70 71 static inline void numa_remove_cpu(int cpu) { } 72 + static inline void init_gi_nodes(void) { } 71 73 #endif /* CONFIG_NUMA */ 72 74 73 75 #ifdef CONFIG_DEBUG_PER_CPU_MAPS
+1
arch/x86/kernel/setup.c
··· 1218 1218 prefill_possible_map(); 1219 1219 1220 1220 init_cpu_to_node(); 1221 + init_gi_nodes(); 1221 1222 1222 1223 io_apic_init_mappings(); 1223 1224
+21
arch/x86/mm/numa.c
··· 748 748 } 749 749 750 750 /* 751 + * A node may exist which has one or more Generic Initiators but no CPUs and no 752 + * memory. 753 + * 754 + * This function must be called after init_cpu_to_node(), to ensure that any 755 + * memoryless CPU nodes have already been brought online, and before the 756 + * node_data[nid] is needed for zone list setup in build_all_zonelists(). 757 + * 758 + * When this function is called, any nodes containing either memory and/or CPUs 759 + * will already be online and there is no need to do anything extra, even if 760 + * they also contain one or more Generic Initiators. 761 + */ 762 + void __init init_gi_nodes(void) 763 + { 764 + int nid; 765 + 766 + for_each_node_state(nid, N_GENERIC_INITIATOR) 767 + if (!node_online(nid)) 768 + init_memory_less_node(nid); 769 + } 770 + 771 + /* 751 772 * Setup early cpu_to_node. 752 773 * 753 774 * Populate cpu_to_node[] only if x86_cpu_to_apicid[],