lkml.org 
[lkml]   [2023]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 7/7] lib/group_cpus: simplify grp_spread_init_one() for more
Date
The outer and inner loops of grp_spread_init_one() do the same thing -
move a bit from nmsk to irqmsk.

The inner loop iterates the sibling group, which includes the CPU picked
by outer loop. And it means that we can drop the part that moves the bit
in the outer loop.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
lib/group_cpus.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/lib/group_cpus.c b/lib/group_cpus.c
index 664a56171a1b..7aa7a6289355 100644
--- a/lib/group_cpus.c
+++ b/lib/group_cpus.c
@@ -18,14 +18,8 @@ static void grp_spread_init_one(struct cpumask *irqmsk, struct cpumask *nmsk,
int cpu, sibl;

for_each_cpu(cpu, nmsk) {
- __cpumask_clear_cpu(cpu, nmsk);
- __cpumask_set_cpu(cpu, irqmsk);
- if (cpus_per_grp-- == 0)
- return;
-
- /* If the cpu has siblings, use them first */
siblmsk = topology_sibling_cpumask(cpu);
- sibl = cpu + 1;
+ sibl = cpu;

for_each_cpu_and_from(sibl, siblmsk, nmsk) {
__cpumask_clear_cpu(sibl, nmsk);
--
2.40.1
\
 
 \ /
  Last update: 2023-12-12 05:22    [W:0.299 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site