Skip to content

Commit 269679b

Browse files
Chen Ridonghtejun
authored andcommitted
cpuset: remove dead code in cpuset-v1.c
The commit 6e1d31c ("cpuset: separate generate_sched_domains for v1 and v2") introduced dead code that was originally added for cpuset-v2 partition domain generation. Remove the redundant root_load_balance check. Fixes: 6e1d31c ("cpuset: separate generate_sched_domains for v1 and v2") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/cgroups/9a442808-ed53-4657-988b-882cc0014c0d@huaweicloud.com/T/ Signed-off-by: Chen Ridong <chenridong@huawei.com> Reviewed-by: Waiman Long <longman@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 7cc1720 commit 269679b

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

kernel/cgroup/cpuset-v1.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,6 @@ int cpuset1_generate_sched_domains(cpumask_var_t **domains,
605605
int ndoms = 0; /* number of sched domains in result */
606606
int nslot; /* next empty doms[] struct cpumask slot */
607607
struct cgroup_subsys_state *pos_css;
608-
bool root_load_balance = is_sched_load_balance(&top_cpuset);
609608
int nslot_update;
610609

611610
lockdep_assert_cpuset_lock_held();
@@ -615,7 +614,7 @@ int cpuset1_generate_sched_domains(cpumask_var_t **domains,
615614
csa = NULL;
616615

617616
/* Special case for the 99% of systems with one, full, sched domain */
618-
if (root_load_balance) {
617+
if (is_sched_load_balance(&top_cpuset)) {
619618
ndoms = 1;
620619
doms = alloc_sched_domains(ndoms);
621620
if (!doms)
@@ -638,8 +637,6 @@ int cpuset1_generate_sched_domains(cpumask_var_t **domains,
638637
csn = 0;
639638

640639
rcu_read_lock();
641-
if (root_load_balance)
642-
csa[csn++] = &top_cpuset;
643640
cpuset_for_each_descendant_pre(cp, pos_css, &top_cpuset) {
644641
if (cp == &top_cpuset)
645642
continue;

0 commit comments

Comments
 (0)