public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen@asianux.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kernel: timer: looping issue, need reset variable 'found'
Date: Tue, 18 Jun 2013 18:42:48 +0800	[thread overview]
Message-ID: <51C039A8.5000903@asianux.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1306101501160.22970@ionos>

On 06/10/2013 10:12 PM, Thomas Gleixner wrote:
> On Sun, 9 Jun 2013, Chen Gang wrote:
> 
>>
>> According to __internal_add_timer(), in _next_timer_interrupt(), when
>> 'tv1.vec' find one, but need 'cascade bucket(s)', we still need find
>> each slot of 'tv*.vec'.
> 
> No, we do not. We only need to scan the first cascade array after the
> enqueued timer. If there is nothing in tv2 which might come before the
> found timer, then any timer in tv3 will be later than the one we found
> in the primary wheel.
> 

If we assume "If there is nothing in tv2 which might come before the
found timer, then any timer in tv3 will ..." is correct.

When we found a timer in 'tv1', we will not search all timers in 'tv2'
(we only search first looping of tv2 for the specific 'slot').

Is it still OK ?


>> So need reset variable 'found', so can fully scan ''do {...} while()''
>> for 'tv*.vec'.
> 
> And thereby lose the information, that we already found a timer in the
> scan of the primary array.
> 

When we found a timer, 'expires' would be set.  So resetting 'found' is
still correct, but may let performance lower (if original implement is
correct too)

I think we can treat original implementation as for speed optimization,
so our discussion is "whether this speed optimization has effect with
correctness".


Thanks.
-- 
Chen Gang

Asianux Corporation

  parent reply	other threads:[~2013-06-18 10:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-09 15:49 [PATCH] kernel: timer: looping issue, need reset variable 'found' Chen Gang
2013-06-10 14:12 ` Thomas Gleixner
2013-06-13  3:39   ` Chen Gang
2013-06-18  3:28     ` Chen Gang
2013-06-18 10:42   ` Chen Gang [this message]
2013-06-20  7:47     ` Thomas Gleixner
2013-06-20  8:26       ` Chen Gang
2013-06-20  9:13         ` Thomas Gleixner
2013-06-20 10:20           ` Chen Gang

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=51C039A8.5000903@asianux.com \
    --to=gang.chen@asianux.com \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox