Skip to content

Commit 4c591db

Browse files
committed
cgroup/cpuset: remove use_parent_ecpus of cpuset
jira NONE_AUTOMATION Rebuild_History Non-Buildable kernel-5.14.0-570.17.1.el9_6 commit-author Chen Ridong <[email protected]> commit 3c2acae use_parent_ecpus is used to track whether the children are using the parent's effective_cpus. When a parent's effective_cpus is changed due to changes in a child partition's effective_xcpus, any child using parent'effective_cpus must call update_cpumasks_hier. However, if a child is not a valid partition, it is sufficient to determine whether to call update_cpumasks_hier based on whether the child's effective_cpus is going to change. To make the code more succinct, it is suggested to remove use_parent_ecpus. Signed-off-by: Chen Ridong <[email protected]> Reviewed-by: Waiman Long <[email protected]> Signed-off-by: Tejun Heo <[email protected]> (cherry picked from commit 3c2acae) Signed-off-by: Jonathan Maple <[email protected]>
1 parent baddaeb commit 4c591db

File tree

1 file changed

+4
-26
lines changed

1 file changed

+4
-26
lines changed

kernel/cgroup/cpuset.c

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,6 @@ struct cpuset {
185185
/* partition root state */
186186
int partition_root_state;
187187

188-
/*
189-
* Default hierarchy only:
190-
* use_parent_ecpus - set if using parent's effective_cpus
191-
*/
192-
int use_parent_ecpus;
193-
194188
/*
195189
* number of SCHED_DEADLINE tasks attached to this cpuset, so that we
196190
* know when to rebuild associated root domain bandwidth information.
@@ -1483,11 +1477,8 @@ static void reset_partition_data(struct cpuset *cs)
14831477
if (is_cpu_exclusive(cs))
14841478
clear_bit(CS_CPU_EXCLUSIVE, &cs->flags);
14851479
}
1486-
if (!cpumask_and(cs->effective_cpus,
1487-
parent->effective_cpus, cs->cpus_allowed)) {
1488-
cs->use_parent_ecpus = true;
1480+
if (!cpumask_and(cs->effective_cpus, parent->effective_cpus, cs->cpus_allowed))
14891481
cpumask_copy(cs->effective_cpus, parent->effective_cpus);
1490-
}
14911482
}
14921483

14931484
/*
@@ -1661,8 +1652,6 @@ static int remote_partition_enable(struct cpuset *cs, int new_prs,
16611652
spin_lock_irq(&callback_lock);
16621653
isolcpus_updated = partition_xcpus_add(new_prs, NULL, tmp->new_cpus);
16631654
list_add(&cs->remote_sibling, &remote_children);
1664-
if (cs->use_parent_ecpus)
1665-
cs->use_parent_ecpus = false;
16661655
spin_unlock_irq(&callback_lock);
16671656
update_unbound_workqueue_cpumask(isolcpus_updated);
16681657

@@ -2287,13 +2276,8 @@ static void update_cpumasks_hier(struct cpuset *cs, struct tmpmasks *tmp,
22872276
* it is a partition root that has explicitly distributed
22882277
* out all its CPUs.
22892278
*/
2290-
if (is_in_v2_mode() && !remote && cpumask_empty(tmp->new_cpus)) {
2279+
if (is_in_v2_mode() && !remote && cpumask_empty(tmp->new_cpus))
22912280
cpumask_copy(tmp->new_cpus, parent->effective_cpus);
2292-
if (!cp->use_parent_ecpus)
2293-
cp->use_parent_ecpus = true;
2294-
} else if (cp->use_parent_ecpus) {
2295-
cp->use_parent_ecpus = false;
2296-
}
22972281

22982282
if (remote)
22992283
goto get_css;
@@ -2430,8 +2414,7 @@ static void update_sibling_cpumasks(struct cpuset *parent, struct cpuset *cs,
24302414
* Check all its siblings and call update_cpumasks_hier()
24312415
* if their effective_cpus will need to be changed.
24322416
*
2433-
* With the addition of effective_xcpus which is a subset of
2434-
* cpus_allowed. It is possible a change in parent's effective_cpus
2417+
* It is possible a change in parent's effective_cpus
24352418
* due to a change in a child partition's effective_xcpus will impact
24362419
* its siblings even if they do not inherit parent's effective_cpus
24372420
* directly.
@@ -2445,8 +2428,7 @@ static void update_sibling_cpumasks(struct cpuset *parent, struct cpuset *cs,
24452428
cpuset_for_each_child(sibling, pos_css, parent) {
24462429
if (sibling == cs)
24472430
continue;
2448-
if (!sibling->use_parent_ecpus &&
2449-
!is_partition_valid(sibling)) {
2431+
if (!is_partition_valid(sibling)) {
24502432
compute_effective_cpumask(tmp->new_cpus, sibling,
24512433
parent);
24522434
if (cpumask_equal(tmp->new_cpus, sibling->effective_cpus))
@@ -4110,7 +4092,6 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
41104092
if (is_in_v2_mode()) {
41114093
cpumask_copy(cs->effective_cpus, parent->effective_cpus);
41124094
cs->effective_mems = parent->effective_mems;
4113-
cs->use_parent_ecpus = true;
41144095
}
41154096
spin_unlock_irq(&callback_lock);
41164097

@@ -4176,9 +4157,6 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css)
41764157
is_sched_load_balance(cs))
41774158
update_flag(CS_SCHED_LOAD_BALANCE, cs, 0);
41784159

4179-
if (cs->use_parent_ecpus)
4180-
cs->use_parent_ecpus = false;
4181-
41824160
cpuset_dec();
41834161
clear_bit(CS_ONLINE, &cs->flags);
41844162

0 commit comments

Comments
 (0)