Skip to content

Commit 303b684

Browse files
committed
cgroup/cpuset: remove child_ecpus_count
jira NONE_AUTOMATION Rebuild_History Non-Buildable kernel-5.14.0-570.17.1.el9_6 commit-author Chen Ridong <[email protected]> commit d632604 The child_ecpus_count variable was previously used to update sibling cpumask when parent's effective_cpus is updated. However, it became obsolete after commit e2ffe50 ("cgroup/cpuset: Add cpuset.cpus.exclusive for v2"). It should be removed. tj: Restored {} for style consistency. Signed-off-by: Chen Ridong <[email protected]> Acked-by: Waiman Long <[email protected]> Signed-off-by: Tejun Heo <[email protected]> (cherry picked from commit d632604) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 70cbac2 commit 303b684

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

kernel/cgroup/cpuset.c

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,8 @@ struct cpuset {
188188
/*
189189
* Default hierarchy only:
190190
* use_parent_ecpus - set if using parent's effective_cpus
191-
* child_ecpus_count - # of children with use_parent_ecpus set
192191
*/
193192
int use_parent_ecpus;
194-
int child_ecpus_count;
195193

196194
/*
197195
* number of SCHED_DEADLINE tasks attached to this cpuset, so that we
@@ -1495,7 +1493,6 @@ static void reset_partition_data(struct cpuset *cs)
14951493
if (!cpumask_and(cs->effective_cpus,
14961494
parent->effective_cpus, cs->cpus_allowed)) {
14971495
cs->use_parent_ecpus = true;
1498-
parent->child_ecpus_count++;
14991496
cpumask_copy(cs->effective_cpus, parent->effective_cpus);
15001497
}
15011498
}
@@ -1671,12 +1668,8 @@ static int remote_partition_enable(struct cpuset *cs, int new_prs,
16711668
spin_lock_irq(&callback_lock);
16721669
isolcpus_updated = partition_xcpus_add(new_prs, NULL, tmp->new_cpus);
16731670
list_add(&cs->remote_sibling, &remote_children);
1674-
if (cs->use_parent_ecpus) {
1675-
struct cpuset *parent = parent_cs(cs);
1676-
1671+
if (cs->use_parent_ecpus)
16771672
cs->use_parent_ecpus = false;
1678-
parent->child_ecpus_count--;
1679-
}
16801673
spin_unlock_irq(&callback_lock);
16811674
update_unbound_workqueue_cpumask(isolcpus_updated);
16821675

@@ -2303,14 +2296,10 @@ static void update_cpumasks_hier(struct cpuset *cs, struct tmpmasks *tmp,
23032296
*/
23042297
if (is_in_v2_mode() && !remote && cpumask_empty(tmp->new_cpus)) {
23052298
cpumask_copy(tmp->new_cpus, parent->effective_cpus);
2306-
if (!cp->use_parent_ecpus) {
2299+
if (!cp->use_parent_ecpus)
23072300
cp->use_parent_ecpus = true;
2308-
parent->child_ecpus_count++;
2309-
}
23102301
} else if (cp->use_parent_ecpus) {
23112302
cp->use_parent_ecpus = false;
2312-
WARN_ON_ONCE(!parent->child_ecpus_count);
2313-
parent->child_ecpus_count--;
23142303
}
23152304

23162305
if (remote)
@@ -4129,7 +4118,6 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
41294118
cpumask_copy(cs->effective_cpus, parent->effective_cpus);
41304119
cs->effective_mems = parent->effective_mems;
41314120
cs->use_parent_ecpus = true;
4132-
parent->child_ecpus_count++;
41334121
}
41344122
spin_unlock_irq(&callback_lock);
41354123

@@ -4195,12 +4183,8 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css)
41954183
is_sched_load_balance(cs))
41964184
update_flag(CS_SCHED_LOAD_BALANCE, cs, 0);
41974185

4198-
if (cs->use_parent_ecpus) {
4199-
struct cpuset *parent = parent_cs(cs);
4200-
4186+
if (cs->use_parent_ecpus)
42014187
cs->use_parent_ecpus = false;
4202-
parent->child_ecpus_count--;
4203-
}
42044188

42054189
cpuset_dec();
42064190
clear_bit(CS_ONLINE, &cs->flags);

0 commit comments

Comments
 (0)