cgroup/cpuset: reduce redundant comparisons for generating shecd domains
Subsystems (3)
PATCH 1/1 cgroup/cpuset: reduce redundant comparisons for generating shecd domains
In the generate_sched_domains function, it's unnecessary to start the second for loop with zero, which leads redundant comparisons. Simply start with i+1, as that is sufficient.
--- kernel/cgroup/cpuset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cgroup/cpuset.c +1 -1
@@ -1113,7 +1113,7 @@ static int generate_sched_domains(cpumask_var_t **domains,struct cpuset *a = csa[i];int apn = a->pn; -for (j =0 ; j < csn; j++) { +for (j = i +1 ; j < csn; j++) {struct cpuset *b = csa[j];int bpn = b->pn;
Signature · 1 line
2.34.1
Michal Koutný
maintainerHello.
Quoted 3 lines · Chen Ridong
In the
generate_sched_domainsfunction, it's unnecessary to start the second for loop with zero, which leads redundant comparisons. Simply start with i+1, as that is sufficient.
Please see
https://lore.kernel.org/r/[email protected]
Your patch is likely obsoleted with that.
Michal
Quoted 7 lines · Michal Koutný
Hello.
Quoted 3 lines · Chen Ridong
In the
generate_sched_domainsfunction, it's unnecessary to start the second for loop with zero, which leads redundant comparisons. Simply start with i+1, as that is sufficient.
Quoted 6 lines
Please see
https://lore.kernel.org/r/[email protected]Your patch is likely obsoleted with that.
Michal
Thanks, Michal, I'm sorry I didn't notice these patches. It's a good idea to optimize with uf_node.
Thanks
Ridong