From: Valentin Schneider <valentin.schneider@arm.com>
To: Yuan ZhaoXiong <yuanzhaoxiong@baidu.com>,
peterz@infradead.org, vincent.donnefort@arm.com,
mingo@kernel.org, bristot@redhat.com, npiggin@gmail.com,
tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpu/hotplug: simplify access percpu cpuhp_state
Date: Tue, 25 May 2021 11:19:27 +0100 [thread overview]
Message-ID: <87k0nnglow.mognet@arm.com> (raw)
In-Reply-To: <1621776690-13264-1-git-send-email-yuanzhaoxiong@baidu.com>
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@baidu.com>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.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
next prev parent reply other threads:[~2021-05-25 10:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-23 13:31 [PATCH] cpu/hotplug: simplify access percpu cpuhp_state Yuan ZhaoXiong
2021-05-25 10:19 ` Valentin Schneider [this message]
2021-05-25 15:30 ` [tip: smp/core] cpu/hotplug: Simplify access to " tip-bot2 for Yuan ZhaoXiong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k0nnglow.mognet@arm.com \
--to=valentin.schneider@arm.com \
--cc=bristot@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=npiggin@gmail.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=vincent.donnefort@arm.com \
--cc=yuanzhaoxiong@baidu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox