lkml.org 
[lkml]   [2020]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC PATCH 10/10] timer: Lower base clock forwarding threshold
Date
Frederic Weisbecker <frederic@kernel.org> writes:
> On Thu, Jul 02, 2020 at 03:21:35PM +0200, Thomas Gleixner wrote:
>> Frederic Weisbecker <frederic@kernel.org> writes:
>> > @@ -883,7 +883,7 @@ static inline void forward_timer_base(struct timer_base *base)
>> > * Also while executing timers, base->clk is 1 offset ahead
>> > * of jiffies to avoid endless requeuing to current jffies.
>> > */
>> > - if ((long)(jnow - base->clk) < 2)
>> > + if ((long)(jnow - base->clk) < 1)
>> > return;
>>
>> The apparent reason is in the comment right above the condition ...
>
> Hmm, that's a comment I added myself in the patch before.

:)

> The following part:
>
>> > * Also while executing timers, base->clk is 1 offset ahead
>> > * of jiffies to avoid endless requeuing to current jffies.
>> > */
>
> relates to situation when (long)(jnow - base->clk) < 0

This still is inconsistent with your changelog:

> There is no apparent reason for not forwarding base->clk when it's 2
> jiffies late

Let's do the math:

jiffies = 4
base->clk = 2

4 - 2 = 2

which means it is forwarded when it's 2 jiffies late with the original
code, because 2 < 2.

The reason for this < 2 is historical and goes back to the oddities of
the original timer wheel before the big rewrite.

Thanks,

tglx


\
 
 \ /
  Last update: 2020-07-02 17:15    [W:0.122 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site