diff options
| author | Olav Haugan <ohaugan@codeaurora.org> | 2016-11-03 13:39:23 -0700 |
|---|---|---|
| committer | Olav Haugan <ohaugan@codeaurora.org> | 2016-11-07 17:51:42 -0800 |
| commit | 34a3cdf14eea4432681380cb3dc4d1a741945ffe (patch) | |
| tree | 5138784efa8a4b350ca12dc66f520191f95dd24a | |
| parent | 411a978bce803f17a0aa757b9491969e0ca60b79 (diff) | |
sched/core: Keep rq online after cpu isolation
To move tasks off a cpu when offlining the rq needs to be offlined to
un-throttle tasks. However, tasks might still run on the CPU even after
the CPU has been isolated (per-CPU threads). Thus we should leave the rq
in online state after tasks have been moved.
Change-Id: I61486e8648af0dbb82595fe699e1bc158e837362
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
| -rw-r--r-- | kernel/sched/core.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f20c706ab24e..be0a110cf788 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5581,15 +5581,21 @@ int do_isolation_work_cpu_stop(void *data) sched_ttwu_pending(); - /* Update our root-domain */ raw_spin_lock(&rq->lock); + /* + * Temporarily mark the rq as offline. This will allow us to + * move tasks off the CPU. + */ if (rq->rd) { BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); set_rq_offline(rq); } migrate_tasks(rq, false); + + if (rq->rd) + set_rq_online(rq); raw_spin_unlock(&rq->lock); /* @@ -5749,10 +5755,6 @@ int sched_unisolate_cpu_unlocked(int cpu) raw_spin_lock_irqsave(&rq->lock, flags); rq->age_stamp = sched_clock_cpu(cpu); - if (rq->rd) { - BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); - set_rq_online(rq); - } raw_spin_unlock_irqrestore(&rq->lock, flags); } |
