From: Nicholas Piggin <npiggin@gmail.com> Date: 2021-11-05 13:30:39
Slab is up at this point, using the bootmem allocator triggers a
warning. Switch to using the regular cpumask allocator.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
This only matters when CONFIG_CPUMASK_OFFNODE=y, which has not been
possible before on powerpc.
Thanks,
Nick
arch/powerpc/platforms/pseries/hotplug-cpu.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
@@ -1016,12 +1016,13 @@ static int __init pseries_cpu_hotplug_init(void)/* Processors can be added/removed only on LPAR */if(firmware_has_feature(FW_FEATURE_LPAR)){for_each_node(node){-alloc_bootmem_cpumask_var(&node_recorded_ids_map[node]);+if(!alloc_cpumask_var_node(&node_recorded_ids_map[node],+GFP_KERNEL,node))+return-ENOMEM;/* Record ids of CPU added at boot time */-cpumask_or(node_recorded_ids_map[node],-node_recorded_ids_map[node],-cpumask_of_node(node));+cpumask_copy(node_recorded_ids_map[node],+cpumask_of_node(node));}of_reconfig_notifier_register(&pseries_smp_nb);
From: Sachin Sant <hidden> Date: 2021-11-07 09:00:05
On 05-Nov-2021, at 6:59 PM, Nicholas Piggin [off-list ref] wrote:
Slab is up at this point, using the bootmem allocator triggers a
warning. Switch to using the regular cpumask allocator.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
Fixes the warning for me. Thanks
Tested-by: Sachin Sant <redacted>
quoted hunk
This only matters when CONFIG_CPUMASK_OFFNODE=y, which has not been
possible before on powerpc.
Thanks,
Nick
arch/powerpc/platforms/pseries/hotplug-cpu.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
@@ -1016,12 +1016,13 @@ static int __init pseries_cpu_hotplug_init(void)
/* Processors can be added/removed only on LPAR */
if (firmware_has_feature(FW_FEATURE_LPAR)) {
for_each_node(node) {
- alloc_bootmem_cpumask_var(&node_recorded_ids_map[node]);
+ if (!alloc_cpumask_var_node(&node_recorded_ids_map[node],
+ GFP_KERNEL, node))
+ return -ENOMEM;
/* Record ids of CPU added at boot time */
- cpumask_or(node_recorded_ids_map[node],
- node_recorded_ids_map[node],
- cpumask_of_node(node));
+ cpumask_copy(node_recorded_ids_map[node],
+ cpumask_of_node(node));
}
of_reconfig_notifier_register(&pseries_smp_nb);
--
2.23.0
Slab is up at this point, using the bootmem allocator triggers a
warning. Switch to using the regular cpumask allocator.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Nathan Lynch <redacted>
quoted hunk
---
This only matters when CONFIG_CPUMASK_OFFNODE=y, which has not been
possible before on powerpc.
Thanks,
Nick
arch/powerpc/platforms/pseries/hotplug-cpu.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
@@ -1016,12 +1016,13 @@ static int __init pseries_cpu_hotplug_init(void)/* Processors can be added/removed only on LPAR */if(firmware_has_feature(FW_FEATURE_LPAR)){for_each_node(node){-alloc_bootmem_cpumask_var(&node_recorded_ids_map[node]);+if(!alloc_cpumask_var_node(&node_recorded_ids_map[node],+GFP_KERNEL,node))+return-ENOMEM;/* Record ids of CPU added at boot time */-cpumask_or(node_recorded_ids_map[node],-node_recorded_ids_map[node],-cpumask_of_node(node));+cpumask_copy(node_recorded_ids_map[node],+cpumask_of_node(node));}of_reconfig_notifier_register(&pseries_smp_nb);
Slab is up at this point, using the bootmem allocator triggers a
warning. Switch to using the regular cpumask allocator.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
This only matters when CONFIG_CPUMASK_OFFNODE=y, which has not been
possible before on powerpc.
@@ -1016,12 +1016,13 @@ static int __init pseries_cpu_hotplug_init(void)/* Processors can be added/removed only on LPAR */if(firmware_has_feature(FW_FEATURE_LPAR)){for_each_node(node){-alloc_bootmem_cpumask_var(&node_recorded_ids_map[node]);+if(!alloc_cpumask_var_node(&node_recorded_ids_map[node],+GFP_KERNEL,node))+return-ENOMEM;/* Record ids of CPU added at boot time */-cpumask_or(node_recorded_ids_map[node],-node_recorded_ids_map[node],-cpumask_of_node(node));+cpumask_copy(node_recorded_ids_map[node],+cpumask_of_node(node));}of_reconfig_notifier_register(&pseries_smp_nb);