lkml.org 
[lkml]   [2018]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] timers: fix offset calculation when the expires align with LVL_GRAN


On Tue, 31 Jul 2018, Thomas Gleixner wrote:

> On Tue, 31 Jul 2018, Xu YiPing wrote:
> > On 2018/7/30 19:03, Thomas Gleixner wrote:
> > >
> > > __internal_add_timer(base, timer)
> > > {
> > > idx = calc_wheel_index(1, 1)
> > > {
> > > delta = 1 - 1; <- 0
> > >
> > > if (0 < LVL_START(1))
> > > idx = calc_index(1, 0)
> > > {
> > > expires = (1 + LVL_GRAN(0) - 1) >> LVL_SHIFT(0);
> > > ----> expires = 0
> >
> > LVL_GRAN(0) = 1 and LVL_SHIFT(0) = 0
> >
> > after the calculation, expires = 1 ?
>
> Indeed. You're right. Math is hard... So the index would be 1 and still not
> fulfil the below:

Hmm, crap. Let me think about it some more. 34C is way too hot to think.

Thanks,

tglx

\
 
 \ /
  Last update: 2018-07-31 16:35    [W:1.242 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site