lkml.org 
[lkml]   [2023]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v8 08/25] timer: Rework idle logic
Date
On Tue, Oct 10 2023 at 13:19, Frederic Weisbecker wrote:
> On Tue, Oct 10, 2023 at 12:15:09AM +0200, Thomas Gleixner wrote:
>> > + base->is_idle = time_after(nextevt, basej + 1);
>>
>> This is wrongly ordered. base->is_idle must be updated _after_
>> evaluating base->timers_pending because the below can change nextevt,
>> no?
>>
>> > + if (base->timers_pending) {
>> > + /* If we missed a tick already, force 0 delta */
>> > + if (time_before(nextevt, basej))
>> > + nextevt = basej;
>> > + expires = basem + (u64)(nextevt - basej) * TICK_NSEC;
>
> I suspect it doesn't matter in pratice: base->is_idle will remain false
> if it's before/equal jiffies.
>
> Still it hurts the eyes so I agree the re-ordering should happen here and
> this will even simplify a bit the next patch.

Right. Anna-Maria just pointed that out to me before, but we are all in
violent agreement that it sucks :)

\
 
 \ /
  Last update: 2023-10-10 13:49    [W:0.073 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site