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

Commit cf0d1f54 authored by Srivatsa Vaddagiri's avatar Srivatsa Vaddagiri Committed by Steve Muckle
Browse files

sched: Add BUG_ON when task_cpu() is incorrect



It would be fatal if task_cpu() information for a task does not
accurately represent the cpu on which its running. All sorts of wierd
issues can arise if that were to happen! Add a BUG_ON() in context
switch to detect such cases.

Change-Id: I4eb2c96c850e2247e22f773bbb6eedb8ccafa49c
Signed-off-by: default avatarSrivatsa Vaddagiri <vatsa@codeaurora.org>
parent cea49887
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3889,6 +3889,8 @@ need_resched:
	clear_tsk_need_resched(prev);
	rq->skip_clock_update = 0;

	BUG_ON(task_cpu(next) != cpu_of(rq));

	if (likely(prev != next)) {
		rq->nr_switches++;
		rq->curr = next;