File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,11 @@ static inline int early_cpu_to_node(int cpu)
66
66
int of_drconf_to_nid_single (struct drmem_lmb * lmb );
67
67
void update_numa_distance (struct device_node * node );
68
68
69
+ extern void map_cpu_to_node (int cpu , int node );
70
+ #ifdef CONFIG_HOTPLUG_CPU
71
+ extern void unmap_cpu_from_node (unsigned long cpu );
72
+ #endif /* CONFIG_HOTPLUG_CPU */
73
+
69
74
#else
70
75
71
76
static inline int early_cpu_to_node (int cpu ) { return 0 ; }
@@ -95,6 +100,14 @@ static inline int of_drconf_to_nid_single(struct drmem_lmb *lmb)
95
100
}
96
101
97
102
static inline void update_numa_distance (struct device_node * node ) {}
103
+
104
+ #ifdef CONFIG_SMP
105
+ static inline void map_cpu_to_node (int cpu , int node ) {}
106
+ #ifdef CONFIG_HOTPLUG_CPU
107
+ static inline void unmap_cpu_from_node (unsigned long cpu ) {}
108
+ #endif /* CONFIG_HOTPLUG_CPU */
109
+ #endif /* CONFIG_SMP */
110
+
98
111
#endif /* CONFIG_NUMA */
99
112
100
113
#if defined(CONFIG_NUMA ) && defined(CONFIG_PPC_SPLPAR )
Original file line number Diff line number Diff line change @@ -1442,6 +1442,8 @@ static void remove_cpu_from_masks(int cpu)
1442
1442
struct cpumask * (* mask_fn )(int ) = cpu_sibling_mask ;
1443
1443
int i ;
1444
1444
1445
+ unmap_cpu_from_node (cpu );
1446
+
1445
1447
if (shared_caches )
1446
1448
mask_fn = cpu_l2_cache_mask ;
1447
1449
@@ -1526,6 +1528,7 @@ static void add_cpu_to_masks(int cpu)
1526
1528
* This CPU will not be in the online mask yet so we need to manually
1527
1529
* add it to it's own thread sibling mask.
1528
1530
*/
1531
+ map_cpu_to_node (cpu , cpu_to_node (cpu ));
1529
1532
cpumask_set_cpu (cpu , cpu_sibling_mask (cpu ));
1530
1533
cpumask_set_cpu (cpu , cpu_core_mask (cpu ));
1531
1534
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ static void reset_numa_cpu_lookup_table(void)
142
142
numa_cpu_lookup_table [cpu ] = -1 ;
143
143
}
144
144
145
- static void map_cpu_to_node (int cpu , int node )
145
+ void map_cpu_to_node (int cpu , int node )
146
146
{
147
147
update_numa_cpu_lookup_table (cpu , node );
148
148
@@ -153,7 +153,7 @@ static void map_cpu_to_node(int cpu, int node)
153
153
}
154
154
155
155
#if defined(CONFIG_HOTPLUG_CPU ) || defined(CONFIG_PPC_SPLPAR )
156
- static void unmap_cpu_from_node (unsigned long cpu )
156
+ void unmap_cpu_from_node (unsigned long cpu )
157
157
{
158
158
int node = numa_cpu_lookup_table [cpu ];
159
159
@@ -800,9 +800,6 @@ static int ppc_numa_cpu_prepare(unsigned int cpu)
800
800
801
801
static int ppc_numa_cpu_dead (unsigned int cpu )
802
802
{
803
- #ifdef CONFIG_HOTPLUG_CPU
804
- unmap_cpu_from_node (cpu );
805
- #endif
806
803
return 0 ;
807
804
}
808
805
You can’t perform that action at this time.
0 commit comments