From: Yury Norov <yury.norov@gmail.com>
To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Cc: Valentin Schneider <vschneid@redhat.com>,
Yury Norov <yury.norov@gmail.com>, Arnd Bergmann <arnd@arndb.de>,
Barry Song <baohua@kernel.org>,
Nicholas Piggin <npiggin@gmail.com>,
Jakub Kicinski <kuba@kernel.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Jeremy Kerr <jk@ozlabs.org>
Subject: [PATCH 2/2] powerpc: use node_has_cpus() instead of nr_cpus_node()
Date: Tue, 21 Feb 2023 18:50:29 -0800 [thread overview]
Message-ID: <20230222025029.453834-2-yury.norov@gmail.com> (raw)
In-Reply-To: <20230222025029.453834-1-yury.norov@gmail.com>
Use node_has_cpus() as more efficient alternative to nr_cpus_node()
where possible.
Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
arch/powerpc/platforms/cell/spu_priv1_mmio.c | 2 +-
arch/powerpc/platforms/cell/spufs/sched.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/cell/spu_priv1_mmio.c b/arch/powerpc/platforms/cell/spu_priv1_mmio.c
index d150e3987304..55b5024b256b 100644
--- a/arch/powerpc/platforms/cell/spu_priv1_mmio.c
+++ b/arch/powerpc/platforms/cell/spu_priv1_mmio.c
@@ -64,7 +64,7 @@ static void cpu_affinity_set(struct spu *spu, int cpu)
u64 target;
u64 route;
- if (nr_cpus_node(spu->node)) {
+ if (node_has_cpus(spu->node)) {
const struct cpumask *spumask = cpumask_of_node(spu->node),
*cpumask = cpumask_of_node(cpu_to_node(cpu));
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 99bd027a7f7c..9d29cc2c6bcb 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -154,7 +154,7 @@ void spu_update_sched_info(struct spu_context *ctx)
static int __node_allowed(struct spu_context *ctx, int node)
{
- if (nr_cpus_node(node)) {
+ if (node_has_cpus(node)) {
const struct cpumask *mask = cpumask_of_node(node);
if (cpumask_intersects(mask, &ctx->cpus_allowed))
--
2.34.1
next prev parent reply other threads:[~2023-02-22 2:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-22 2:50 [PATCH 1/2] sched/topology: introduce node_has_cpus() macro Yury Norov
2023-02-22 2:50 ` Yury Norov [this message]
2023-03-15 16:48 ` [PATCH 2/2] powerpc: use node_has_cpus() instead of nr_cpus_node() Valentin Schneider
2023-03-15 16:48 ` [PATCH 1/2] sched/topology: introduce node_has_cpus() macro Valentin Schneider
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=20230222025029.453834-2-yury.norov@gmail.com \
--to=yury.norov@gmail.com \
--cc=arnd@arndb.de \
--cc=baohua@kernel.org \
--cc=dietmar.eggemann@arm.com \
--cc=jk@ozlabs.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.com \
--cc=vschneid@redhat.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;
as well as URLs for NNTP newsgroup(s).