ANDROID: cgroup/cpuset: rely on active_mask for guaranteed online CPU

In the event of a partial hotunplug, a stable state with a CPU set in the
online_mask and cleared from active_mask can happen. An online CPU, from a
scheduler point of view, should be part of the cpu_active_mask.

Bug: 161210528
Change-Id: I0d0aa6fca4c6dc145634c4aad6519045e0afc8e2
Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>
This commit is contained in:
Vincent Donnefort
2020-08-19 15:33:15 +01:00
committed by Todd Kjos
parent 75d6951cf8
commit bca99ddbf0
+4 -4
View File
@@ -369,13 +369,13 @@ static inline bool is_in_v2_mode(void)
* until we find one that does have some online cpus.
*
* One way or another, we guarantee to return some non-empty subset
* of cpu_online_mask.
* of cpu_active_mask.
*
* Call with callback_lock or cpuset_mutex held.
*/
static void guarantee_online_cpus(struct cpuset *cs, struct cpumask *pmask)
{
while (!cpumask_intersects(cs->effective_cpus, cpu_online_mask)) {
while (!cpumask_intersects(cs->effective_cpus, cpu_active_mask)) {
cs = parent_cs(cs);
if (unlikely(!cs)) {
/*
@@ -385,11 +385,11 @@ static void guarantee_online_cpus(struct cpuset *cs, struct cpumask *pmask)
* cpuset's effective_cpus is on its way to be
* identical to cpu_online_mask.
*/
cpumask_copy(pmask, cpu_online_mask);
cpumask_copy(pmask, cpu_active_mask);
return;
}
}
cpumask_and(pmask, cs->effective_cpus, cpu_online_mask);
cpumask_and(pmask, cs->effective_cpus, cpu_active_mask);
}
/*