|
@@ -215,8 +215,15 @@ static int power_saving_thread(void *data)
|
|
* borrow CPU time from this CPU and cause RT task use > 95%
|
|
* borrow CPU time from this CPU and cause RT task use > 95%
|
|
* CPU time. To make 'avoid starvation' work, takes a nap here.
|
|
* CPU time. To make 'avoid starvation' work, takes a nap here.
|
|
*/
|
|
*/
|
|
- if (do_sleep)
|
|
|
|
|
|
+ if (unlikely(do_sleep))
|
|
schedule_timeout_killable(HZ * idle_pct / 100);
|
|
schedule_timeout_killable(HZ * idle_pct / 100);
|
|
|
|
+
|
|
|
|
+ /* If an external event has set the need_resched flag, then
|
|
|
|
+ * we need to deal with it, or this loop will continue to
|
|
|
|
+ * spin without calling __mwait().
|
|
|
|
+ */
|
|
|
|
+ if (unlikely(need_resched()))
|
|
|
|
+ schedule();
|
|
}
|
|
}
|
|
|
|
|
|
exit_round_robin(tsk_index);
|
|
exit_round_robin(tsk_index);
|