Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <swood@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/1578736419-14628-2-git-send-email-swood@redhat.com

authored by

Scott Wood and committed by
Ingo Molnar
488603b8 afa70d94

+10 -8
+10 -8
kernel/sched/core.c
··· 3669 3669 * statistics and checks timeslices in a time-independent way, regardless 3670 3670 * of when exactly it is running. 3671 3671 */ 3672 - if (idle_cpu(cpu) || !tick_nohz_tick_stopped_cpu(cpu)) 3672 + if (!tick_nohz_tick_stopped_cpu(cpu)) 3673 3673 goto out_requeue; 3674 3674 3675 3675 rq_lock_irq(rq, &rf); 3676 3676 curr = rq->curr; 3677 - if (is_idle_task(curr) || cpu_is_offline(cpu)) 3677 + if (cpu_is_offline(cpu)) 3678 3678 goto out_unlock; 3679 3679 3680 3680 update_rq_clock(rq); 3681 - delta = rq_clock_task(rq) - curr->se.exec_start; 3682 3681 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 + } 3688 3690 curr->sched_class->task_tick(rq, curr, 0); 3689 3691 3690 3692 out_unlock: