All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xu YiPing <xuyiping@hisilicon.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: <john.stultz@linaro.org>, <sboyd@kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] timers: fix offset calculation when the expires align with LVL_GRAN
Date: Wed, 1 Aug 2018 10:45:16 +0800	[thread overview]
Message-ID: <86709eae-fa35-e36a-cafd-2c917d188276@hisilicon.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1807311633430.1610@nanos.tec.linutronix.de>



On 2018/7/31 22:34, Thomas Gleixner wrote:
> 
> 
> 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.
> 

	when the expire is aligned with LVL_GRAN(x), it could be triggered at expire,
no need to wait another LVL_GRAN(x).

	just a little improvement, useful when expire is small.

> Thanks,
> 
> 	tglx
> 
> .
> 


  reply	other threads:[~2018-08-01  2:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27  5:33 [PATCH] timers: fix offset calculation when the expires align with LVL_GRAN Xu YiPing
2018-07-30 11:03 ` Thomas Gleixner
2018-07-31 12:37   ` Xu YiPing
2018-07-31 13:45   ` Xu YiPing
2018-07-31 14:22     ` Thomas Gleixner
2018-07-31 14:34       ` Thomas Gleixner
2018-08-01  2:45         ` Xu YiPing [this message]
2018-08-01  7:10           ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86709eae-fa35-e36a-cafd-2c917d188276@hisilicon.com \
    --to=xuyiping@hisilicon.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.