[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4673661c-b6c0-4188-a98c-83dfdda48a13@paulmck-laptop>
Date: Tue, 9 Jul 2024 10:41:25 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Zqiang <qiang.zhang1211@...il.com>
Cc: imran.f.khan@...cle.com, tglx@...utronix.de,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] smp: Fix missed destroy_work_on_stack() calls in
smp_call_on_cpu()
On Thu, Jul 04, 2024 at 02:52:13PM +0800, Zqiang wrote:
> For builts with CONFIG_DEBUG_OBJECTS_WORK=y kernels, the sscs.work
> defined using INIT_WORK_ONSTACK() will be initialized by
> debug_object_init_on_stack() for debug check in __init_work().
> This commit therefore invoke destroy_work_on_stack() to free
> sscs.work debug objects before smp_call_on_cpu() returns.
>
> Signed-off-by: Zqiang <qiang.zhang1211@...il.com>
I have queued this for testing. My guess is that it should go to
mainline some other way, so:
Tested-by: Paul E. McKenney <paulmck@...nel.org>
> ---
> kernel/smp.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/smp.c b/kernel/smp.c
> index cc13e73a887c..61f10f982341 100644
> --- a/kernel/smp.c
> +++ b/kernel/smp.c
> @@ -1135,6 +1135,7 @@ int smp_call_on_cpu(unsigned int cpu, int (*func)(void *), void *par, bool phys)
>
> queue_work_on(cpu, system_wq, &sscs.work);
> wait_for_completion(&sscs.done);
> + destroy_work_on_stack(&sscs.work);
>
> return sscs.ret;
> }
> --
> 2.17.1
>
Powered by blists - more mailing lists