Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3d85472 authored by Olav Haugan's avatar Olav Haugan Committed by Satya Durga Srinivasu Prabhala
Browse files

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: I9b1e0a21a22acea7c55b126fdbc20355697950a0
Signed-off-by: default avatarOlav Haugan <ohaugan@codeaurora.org>
[markivx: Fix minor merge conflict]
Signed-off-by: default avatarVikram Mulukutla <markivx@codeaurora.org>
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent c2e42230
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -5824,12 +5824,18 @@ int do_isolation_work_cpu_stop(void *data)
	/* Update our root-domain */
	raw_spin_lock_irqsave(&rq->lock, flags);

	/*
	 * 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, &rf, false);
	if (rq->rd)
		set_rq_online(rq);
	raw_spin_unlock_irqrestore(&rq->lock, flags);

	return 0;
@@ -5957,7 +5963,6 @@ int sched_isolate_cpu(int cpu)
int sched_unisolate_cpu_unlocked(int cpu)
{
	int ret_code = 0;
	struct rq *rq = cpu_rq(cpu);
	u64 start_time = 0;

	if (trace_sched_isolate_enabled())
@@ -5973,17 +5978,6 @@ int sched_unisolate_cpu_unlocked(int cpu)
	if (--cpu_isolation_vote[cpu])
		goto out;

	if (cpu_online(cpu)) {
		unsigned long flags;

		raw_spin_lock_irqsave(&rq->lock, flags);
		if (rq->rd) {
			BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span));
			set_rq_online(rq);
		}
		raw_spin_unlock_irqrestore(&rq->lock, flags);
	}

	set_cpu_isolated(cpu, false);
	update_max_interval();
	sched_update_group_capacities(cpu);