lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 31 Jul 2018 16:22:15 +0200 (CEST)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Xu YiPing <xuyiping@...ilicon.com>
cc:     john.stultz@...aro.org, sboyd@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] timers: fix offset calculation when the expires align
 with LVL_GRAN

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:
 
> >       mod_timer(timer, jiffies + 1)
> > 
> > will not fire before aty least one jiffy has elapsed. Let's look at the
> > time line:
> > 
> >    |-------------------|-------------------|----------------|
> >   tick               tick                tick
> >  jiffies	   jiffies + 1        jiffies + 2
> > 
> >    |                   |
> >    |  Any timer armed  |                   ^
> >    |  here must be     |                   |
> >    |  queued here -------------------------|
> > 
> > in order to guarantee that. Timer wheel timers are not accurate and never
> > can be.

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ