|
@@ -1628,8 +1628,10 @@ void wake_up_if_idle(int cpu)
|
|
|
struct rq *rq = cpu_rq(cpu);
|
|
|
unsigned long flags;
|
|
|
|
|
|
- if (!is_idle_task(rq->curr))
|
|
|
- return;
|
|
|
+ rcu_read_lock();
|
|
|
+
|
|
|
+ if (!is_idle_task(rcu_dereference(rq->curr)))
|
|
|
+ goto out;
|
|
|
|
|
|
if (set_nr_if_polling(rq->idle)) {
|
|
|
trace_sched_wake_idle_without_ipi(cpu);
|
|
@@ -1640,6 +1642,9 @@ void wake_up_if_idle(int cpu)
|
|
|
/* Else cpu is not in idle, do nothing here */
|
|
|
raw_spin_unlock_irqrestore(&rq->lock, flags);
|
|
|
}
|
|
|
+
|
|
|
+out:
|
|
|
+ rcu_read_unlock();
|
|
|
}
|
|
|
|
|
|
bool cpus_share_cache(int this_cpu, int that_cpu)
|