lkml.org 
[lkml]   [2023]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v8 02/25] tick-sched: Warn when next tick seems to be in the past
    Date
    When the next tick is in the past, the delta between basemono and the next
    tick gets negativ. But the next tick should never be in the past. The
    negative effect of a wrong next tick might be a stop of the tick and timers
    might expire late.

    To prevent expensive debugging when changing underlying code, add a
    WARN_ON_ONCE into this code path.

    Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
    Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
    ---
    kernel/time/tick-sched.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
    index bdad2abdc0c7..b3cf535881a4 100644
    --- a/kernel/time/tick-sched.c
    +++ b/kernel/time/tick-sched.c
    @@ -842,6 +842,8 @@ static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu)
    * If the tick is due in the next period, keep it ticking or
    * force prod the timer.
    */
    + WARN_ON_ONCE(basemono > next_tick);
    +
    delta = next_tick - basemono;
    if (delta <= (u64)TICK_NSEC) {
    /*
    --
    2.39.2
    \
     
     \ /
      Last update: 2023-10-04 14:37    [W:4.179 / U:0.096 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site