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

Commit ad3fb3bd authored by Satya Durga Srinivasu Prabhala's avatar Satya Durga Srinivasu Prabhala
Browse files

sched/fair: fix "BUG: sleeping function called from invalid context"



Commit 39d60ed9 ("sched/fair: Add snapshot of placement changes")
introduced a bug where we end up calling rcu_read_unlock() without
calling rcu_read_lock() and leading to warning "BUG: sleeping function
called from invalid context" while trying to find the energy efficient CPU
for the tasks.

Change-Id: I727d11660ed43341751dfb6e6f8d23968dfe9b49
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 3e9ffe23
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -7390,7 +7390,7 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu, int sy
				bias_to_waker_cpu(p, cpu, rtg_target)) {
		best_energy_cpu = cpu;
		fbt_env.fastpath = SYNC_WAKEUP;
		goto unlock;
		goto sync_wakeup;
	}

	rcu_read_lock();
@@ -7471,6 +7471,7 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu, int sy
unlock:
	rcu_read_unlock();

sync_wakeup:
	trace_sched_task_util(p, best_energy_cpu, sync,
			need_idle, fbt_env.fastpath, placement_boost,
			rtg_target ? cpumask_first(rtg_target) : -1, start_t);