* [PATCH] powerpc/pseries: use slab context cpumask allocation in CPU hotplug init
@ 2021-11-05 13:29 Nicholas Piggin
2021-11-07 8:59 ` Sachin Sant
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Nicholas Piggin @ 2021-11-05 13:29 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin
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(-)
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index d646c22e94ab..78a70ba60d24 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/pseries: use slab context cpumask allocation in CPU hotplug init
2021-11-05 13:29 [PATCH] powerpc/pseries: use slab context cpumask allocation in CPU hotplug init Nicholas Piggin
@ 2021-11-07 8:59 ` Sachin Sant
2021-11-09 2:14 ` Nathan Lynch
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Sachin Sant @ 2021-11-07 8:59 UTC (permalink / raw)
To: Nicholas Piggin; +Cc: linuxppc-dev
> On 05-Nov-2021, at 6:59 PM, Nicholas Piggin <npiggin@gmail.com> 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 <sachinp@linux.vnet.ibm.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(-)
>
> diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
> index d646c22e94ab..78a70ba60d24 100644
> --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
> +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
> @@ -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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/pseries: use slab context cpumask allocation in CPU hotplug init
2021-11-05 13:29 [PATCH] powerpc/pseries: use slab context cpumask allocation in CPU hotplug init Nicholas Piggin
2021-11-07 8:59 ` Sachin Sant
@ 2021-11-09 2:14 ` Nathan Lynch
2021-11-09 10:27 ` Laurent Dufour
2021-12-21 12:14 ` Michael Ellerman
3 siblings, 0 replies; 5+ messages in thread
From: Nathan Lynch @ 2021-11-09 2:14 UTC (permalink / raw)
To: Nicholas Piggin; +Cc: ldufour, linuxppc-dev
Nicholas Piggin <npiggin@gmail.com> writes:
> 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 <nathanl@linux.ibm.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(-)
>
> diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
> index d646c22e94ab..78a70ba60d24 100644
> --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
> +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
> @@ -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);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/pseries: use slab context cpumask allocation in CPU hotplug init
2021-11-05 13:29 [PATCH] powerpc/pseries: use slab context cpumask allocation in CPU hotplug init Nicholas Piggin
2021-11-07 8:59 ` Sachin Sant
2021-11-09 2:14 ` Nathan Lynch
@ 2021-11-09 10:27 ` Laurent Dufour
2021-12-21 12:14 ` Michael Ellerman
3 siblings, 0 replies; 5+ messages in thread
From: Laurent Dufour @ 2021-11-09 10:27 UTC (permalink / raw)
To: Nicholas Piggin, linuxppc-dev
Le 05/11/2021 à 14:29, Nicholas Piggin a écrit :
> 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,
Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>
> Thanks,
> Nick
>
> arch/powerpc/platforms/pseries/hotplug-cpu.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
> index d646c22e94ab..78a70ba60d24 100644
> --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
> +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
> @@ -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);
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/pseries: use slab context cpumask allocation in CPU hotplug init
2021-11-05 13:29 [PATCH] powerpc/pseries: use slab context cpumask allocation in CPU hotplug init Nicholas Piggin
` (2 preceding siblings ...)
2021-11-09 10:27 ` Laurent Dufour
@ 2021-12-21 12:14 ` Michael Ellerman
3 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2021-12-21 12:14 UTC (permalink / raw)
To: linuxppc-dev, Nicholas Piggin
On Fri, 5 Nov 2021 23:29:23 +1000, Nicholas Piggin wrote:
> Slab is up at this point, using the bootmem allocator triggers a
> warning. Switch to using the regular cpumask allocator.
>
>
Applied to powerpc/next.
[1/1] powerpc/pseries: use slab context cpumask allocation in CPU hotplug init
https://git.kernel.org/powerpc/c/3b54c71537d7beaaca8be9c57a81045e2b641655
cheers
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-12-21 12:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05 13:29 [PATCH] powerpc/pseries: use slab context cpumask allocation in CPU hotplug init Nicholas Piggin
2021-11-07 8:59 ` Sachin Sant
2021-11-09 2:14 ` Nathan Lynch
2021-11-09 10:27 ` Laurent Dufour
2021-12-21 12:14 ` Michael Ellerman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.