|
@@ -650,6 +650,24 @@ static inline bool got_nohz_idle_kick(void)
|
|
|
|
|
|
#endif /* CONFIG_NO_HZ_COMMON */
|
|
|
|
|
|
+#ifdef CONFIG_NO_HZ_FULL
|
|
|
+bool sched_can_stop_tick(void)
|
|
|
+{
|
|
|
+ struct rq *rq;
|
|
|
+
|
|
|
+ rq = this_rq();
|
|
|
+
|
|
|
+ /* Make sure rq->nr_running update is visible after the IPI */
|
|
|
+ smp_rmb();
|
|
|
+
|
|
|
+ /* More than one running task need preemption */
|
|
|
+ if (rq->nr_running > 1)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ return true;
|
|
|
+}
|
|
|
+#endif /* CONFIG_NO_HZ_FULL */
|
|
|
+
|
|
|
void sched_avg_update(struct rq *rq)
|
|
|
{
|
|
|
s64 period = sched_avg_period();
|