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: [PATCH] kernel: timer: looping issue, need reset variable 'found'
Date: Sun, 09 Jun 2013 23:49:28 +0800	[thread overview]
Message-ID: <51B4A408.4050909@asianux.com> (raw)


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'.

So need reset variable 'found', so can fully scan ''do {...} while()''
for 'tv*.vec'.


Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 kernel/timer.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/timer.c b/kernel/timer.c
index aa8b964..0fce618 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1197,7 +1197,7 @@ static unsigned long __next_timer_interrupt(struct tvec_base *base)
 {
 	unsigned long timer_jiffies = base->timer_jiffies;
 	unsigned long expires = timer_jiffies + NEXT_TIMER_MAX_DELTA;
-	int index, slot, array, found = 0;
+	int index, slot, array;
 	struct timer_list *nte;
 	struct tvec *varray[4];
 
@@ -1208,7 +1208,6 @@ static unsigned long __next_timer_interrupt(struct tvec_base *base)
 			if (tbase_get_deferrable(nte->base))
 				continue;
 
-			found = 1;
 			expires = nte->expires;
 			/* Look at the cascade bucket(s)? */
 			if (!index || slot < index)
@@ -1232,6 +1231,7 @@ cascade:
 
 	for (array = 0; array < 4; array++) {
 		struct tvec *varp = varray[array];
+		bool found = false;
 
 		index = slot = timer_jiffies & TVN_MASK;
 		do {
@@ -1239,7 +1239,7 @@ cascade:
 				if (tbase_get_deferrable(nte->base))
 					continue;
 
-				found = 1;
+				found = true;
 				if (time_before(nte->expires, expires))
 					expires = nte->expires;
 			}
-- 
1.7.7.6

             reply	other threads:[~2013-06-09 15:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-09 15:49 Chen Gang [this message]
2013-06-10 14:12 ` [PATCH] kernel: timer: looping issue, need reset variable 'found' Thomas Gleixner
2013-06-13  3:39   ` Chen Gang
2013-06-18  3:28     ` Chen Gang
2013-06-18 10:42   ` Chen Gang
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=51B4A408.4050909@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