[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87k0nnglow.mognet@arm.com>
Date: Tue, 25 May 2021 11:19:27 +0100
From: Valentin Schneider <valentin.schneider@....com>
To: Yuan ZhaoXiong <yuanzhaoxiong@...du.com>, peterz@...radead.org,
vincent.donnefort@....com, mingo@...nel.org, bristot@...hat.com,
npiggin@...il.com, tglx@...utronix.de
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cpu/hotplug: simplify access percpu cpuhp_state
On 23/05/21 21:31, Yuan ZhaoXiong wrote:
> It is unnecessary to invoke per_cpu_ptr() function everytime to access
> percpu cpuhp_state and use the variable st instead.
>
> Signed-off-by: Yuan ZhaoXiong <yuanzhaoxiong@...du.com>
Reviewed-by: Valentin Schneider <valentin.schneider@....com>
> ---
> kernel/cpu.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/cpu.c b/kernel/cpu.c
> index e538518..2942cb4 100644
> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -961,7 +961,7 @@ static int takedown_cpu(unsigned int cpu)
> int err;
>
> /* Park the smpboot threads */
> - kthread_park(per_cpu_ptr(&cpuhp_state, cpu)->thread);
> + kthread_park(st->thread);
>
> /*
> * Prevent irq alloc/free while the dying cpu reorganizes the
> @@ -977,7 +977,7 @@ static int takedown_cpu(unsigned int cpu)
> /* CPU refused to die */
> irq_unlock_sparse();
> /* Unpark the hotplug thread so we can rollback there */
> - kthread_unpark(per_cpu_ptr(&cpuhp_state, cpu)->thread);
> + kthread_unpark(st->thread);
> return err;
> }
> BUG_ON(cpu_online(cpu));
> --
> 1.7.1
Powered by blists - more mailing lists