lkml.org 
[lkml]   [2021]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/10] tick/nohz: Prevent tick_nohz_get_sleep_length() from returning negative value
On Thu, Mar 11, 2021 at 01:36:59PM +0100, Frederic Weisbecker wrote:
> From: "Zhou Ti (x2019cwm)" <x2019cwm@stfx.ca>
>
> If the hardware clock happens to fire its interrupts late, two possible
> issues can happen while calling tick_nohz_get_sleep_length(). Either:
>
> 1) The next clockevent device event is due past the last idle entry time.
>
> or:
>
> 2) The last timekeeping update happened before the last idle entry time
> and the next timer callback expires before the last idle entry time.
>
> Make sure that both cases are handled to avoid returning a negative
> duration to the cpuidle governors.

Why? ... and wouldn't it be cheaper the fix the caller to
check negative once, instead of adding two branches here?

\
 
 \ /
  Last update: 2021-03-16 13:40    [W:0.646 / U:0.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site