diff options
| author | Syed Rameez Mustafa <rameezmustafa@codeaurora.org> | 2016-09-30 17:21:40 -0700 |
|---|---|---|
| committer | Syed Rameez Mustafa <rameezmustafa@codeaurora.org> | 2016-09-30 17:25:51 -0700 |
| commit | 84589336cdd5db269f95dfb8a07bdb8bb13d1dd9 (patch) | |
| tree | b2add2e0542912ee074fe3b1aa96cb446b3e7edb /kernel | |
| parent | 46692be6dd06ce405cb09cf8338b1f0edbbfb295 (diff) | |
sched: Fix CPU selection when all online CPUs are isolated
After the introduction of "33c24b sched: add cpu isolation support"
select_fallback_rq() might sometimes be unable find any CPU to place
a task on. This happens when the all online CPUs are isolated and
the allow isolated flag is set to false. In such cases, we have
little choice but to use an isolated CPU and wait for core control
to eventually un-isolate one or more online CPUs.
Change-Id: Id8738bd8493c11731c5491efcc99eb90f051233e
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/sched/core.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 609aa2e588d7..379aba3b37c4 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1590,7 +1590,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p, bool allow_iso) { int nid = cpu_to_node(cpu); const struct cpumask *nodemask = NULL; - enum { cpuset, possible, fail } state = cpuset; + enum { cpuset, possible, fail, bug } state = cpuset; int dest_cpu; int isolated_candidate = -1; @@ -1650,6 +1650,11 @@ static int select_fallback_rq(int cpu, struct task_struct *p, bool allow_iso) break; case fail: + allow_iso = true; + state = bug; + break; + + case bug: BUG(); break; } |
