Skip to content

Commit 73bf738

Browse files
jic23rafaeljw
authored andcommitted
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>
1 parent 894c26a commit 73bf738

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

arch/x86/include/asm/numa.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ extern void numa_clear_node(int cpu);
6262
extern void __init init_cpu_to_node(void);
6363
extern void numa_add_cpu(int cpu);
6464
extern void numa_remove_cpu(int cpu);
65+
extern void init_gi_nodes(void);
6566
#else /* CONFIG_NUMA */
6667
static inline void numa_set_node(int cpu, int node) { }
6768
static inline void numa_clear_node(int cpu) { }
6869
static inline void init_cpu_to_node(void) { }
6970
static inline void numa_add_cpu(int cpu) { }
7071
static inline void numa_remove_cpu(int cpu) { }
72+
static inline void init_gi_nodes(void) { }
7173
#endif /* CONFIG_NUMA */
7274

7375
#ifdef CONFIG_DEBUG_PER_CPU_MAPS

arch/x86/kernel/setup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,6 +1218,7 @@ void __init setup_arch(char **cmdline_p)
12181218
prefill_possible_map();
12191219

12201220
init_cpu_to_node();
1221+
init_gi_nodes();
12211222

12221223
io_apic_init_mappings();
12231224

arch/x86/mm/numa.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,27 @@ static void __init init_memory_less_node(int nid)
747747
*/
748748
}
749749

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+
750771
/*
751772
* Setup early cpu_to_node.
752773
*

0 commit comments

Comments
 (0)