Skip to content

Commit 488603b

Browse files
crwood-rhIngo Molnar
authored andcommitted
sched/core: Don't skip remote tick for idle CPUs
This will be used in the next patch to get a loadavg update from nohz cpus. The delta check is skipped because idle_sched_class doesn't update se.exec_start. Signed-off-by: Scott Wood <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent afa70d9 commit 488603b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

kernel/sched/core.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3669,22 +3669,24 @@ static void sched_tick_remote(struct work_struct *work)
36693669
* statistics and checks timeslices in a time-independent way, regardless
36703670
* of when exactly it is running.
36713671
*/
3672-
if (idle_cpu(cpu) || !tick_nohz_tick_stopped_cpu(cpu))
3672+
if (!tick_nohz_tick_stopped_cpu(cpu))
36733673
goto out_requeue;
36743674

36753675
rq_lock_irq(rq, &rf);
36763676
curr = rq->curr;
3677-
if (is_idle_task(curr) || cpu_is_offline(cpu))
3677+
if (cpu_is_offline(cpu))
36783678
goto out_unlock;
36793679

36803680
update_rq_clock(rq);
3681-
delta = rq_clock_task(rq) - curr->se.exec_start;
36823681

3683-
/*
3684-
* Make sure the next tick runs within a reasonable
3685-
* amount of time.
3686-
*/
3687-
WARN_ON_ONCE(delta > (u64)NSEC_PER_SEC * 3);
3682+
if (!is_idle_task(curr)) {
3683+
/*
3684+
* Make sure the next tick runs within a reasonable
3685+
* amount of time.
3686+
*/
3687+
delta = rq_clock_task(rq) - curr->se.exec_start;
3688+
WARN_ON_ONCE(delta > (u64)NSEC_PER_SEC * 3);
3689+
}
36883690
curr->sched_class->task_tick(rq, curr, 0);
36893691

36903692
out_unlock:

0 commit comments

Comments
 (0)