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

Commit 4543aba0 authored by Olav Haugan's avatar Olav Haugan
Browse files

sched: Update task->on_rq when tasks are moving between runqueues



Task->on_rq has three states:
	0 - Task is not on runqueue (rq)
	1 (TASK_ON_RQ_QUEUED) - Task is on rq
	2 (TASK_ON_RQ_MIGRATING) - Task is on rq but in the
	process of being migrated to another rq

When a task is moving between rqs task->on_rq state should be
TASK_ON_RQ_MIGRATING

CRs-fixed: 884720
Change-Id: I1572aba00a0273d4ad5bc9a3dd60fb68e2f0b895
Signed-off-by: default avatarOlav Haugan <ohaugan@codeaurora.org>
parent 33697ae3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2727,7 +2727,9 @@ static void __migrate_swap_task(struct task_struct *p, int cpu)
		dst_rq = cpu_rq(cpu);

		deactivate_task(src_rq, p, 0);
		p->on_rq = TASK_ON_RQ_MIGRATING;
		set_task_cpu(p, cpu);
		p->on_rq = TASK_ON_RQ_QUEUED;
		activate_task(dst_rq, p, 0);
		check_preempt_curr(dst_rq, p, 0);
	} else {
+4 −0
Original line number Diff line number Diff line
@@ -1408,7 +1408,9 @@ retry:
	}

	deactivate_task(rq, next_task, 0);
	next_task->on_rq = TASK_ON_RQ_MIGRATING;
	set_task_cpu(next_task, later_rq->cpu);
	next_task->on_rq = TASK_ON_RQ_QUEUED;
	activate_task(later_rq, next_task, 0);

	resched_curr(later_rq);
@@ -1494,7 +1496,9 @@ static int pull_dl_task(struct rq *this_rq)
			ret = 1;

			deactivate_task(src_rq, p, 0);
			p->on_rq = TASK_ON_RQ_MIGRATING;
			set_task_cpu(p, this_cpu);
			p->on_rq = TASK_ON_RQ_QUEUED;
			activate_task(this_rq, p, 0);
			dmin = p->dl.deadline;

+4 −0
Original line number Diff line number Diff line
@@ -1918,7 +1918,9 @@ retry:
	}

	deactivate_task(rq, next_task, 0);
	next_task->on_rq = TASK_ON_RQ_MIGRATING;
	set_task_cpu(next_task, lowest_rq->cpu);
	next_task->on_rq = TASK_ON_RQ_QUEUED;
	activate_task(lowest_rq, next_task, 0);
	ret = 1;

@@ -2006,7 +2008,9 @@ static int pull_rt_task(struct rq *this_rq)
			ret = 1;

			deactivate_task(src_rq, p, 0);
			p->on_rq = TASK_ON_RQ_MIGRATING;
			set_task_cpu(p, this_cpu);
			p->on_rq = TASK_ON_RQ_QUEUED;
			activate_task(this_rq, p, 0);
			/*
			 * We continue with the search, just in