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

Commit fd29eefe authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched: fix race between try_to_wake_up() and move_task()"

parents ea6159cc a0cdd5ba
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1642,8 +1642,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
	 */
	smp_mb__before_spinlock();
	raw_spin_lock_irqsave(&p->pi_lock, flags);
	src_cpu = task_cpu(p);
	cpu = src_cpu;
	src_cpu = cpu = task_cpu(p);

	if (!(p->state & state))
		goto out;
@@ -1672,6 +1671,9 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
		p->sched_class->task_waking(p);

	cpu = select_task_rq(p, SD_BALANCE_WAKE, wake_flags);

	/* Refresh src_cpu as it could have changed since we last read it */
	src_cpu = task_cpu(p);
	if (src_cpu != cpu) {
		wake_flags |= WF_MIGRATED;
		set_task_cpu(p, cpu);