diff options
| author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-08-03 20:51:01 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-08-03 20:51:00 -0700 |
| commit | 1625604b6eccdc4edc0be983cf4078346dc39df4 (patch) | |
| tree | fb56275514e5a4db971f26143b1c4224a4386be1 /kernel | |
| parent | 73c7c075c8aa2f9a0f033b79a4f33ed6aacbd3dc (diff) | |
| parent | f261bf42cc8e5c111891650010aead9be58cefbc (diff) | |
Merge "sched: avoid RT tasks contention during sched boost"
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/sched/rt.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index c03d51a017bf..ee095f4e7230 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1823,6 +1823,7 @@ static int find_lowest_rq_hmp(struct task_struct *task) * the best one based on our affinity and topology. */ +retry: for_each_sched_cluster(cluster) { if (boost_on_big && cluster->capacity != max_possible_capacity) continue; @@ -1830,6 +1831,15 @@ static int find_lowest_rq_hmp(struct task_struct *task) cpumask_and(&candidate_mask, &cluster->cpus, lowest_mask); cpumask_andnot(&candidate_mask, &candidate_mask, cpu_isolated_mask); + /* + * When placement boost is active, if there is no eligible CPU + * in the highest capacity cluster, we fallback to the other + * clusters. So clear the CPUs of the traversed cluster from + * the lowest_mask. + */ + if (unlikely(boost_on_big)) + cpumask_andnot(lowest_mask, lowest_mask, + &cluster->cpus); if (cpumask_empty(&candidate_mask)) continue; @@ -1869,6 +1879,11 @@ static int find_lowest_rq_hmp(struct task_struct *task) break; } + if (unlikely(boost_on_big && best_cpu == -1)) { + boost_on_big = 0; + goto retry; + } + return best_cpu; } #endif /* CONFIG_SCHED_HMP */ |
