From: Emmanuel Ackaouy <ack@xensource.com>
To: linux-kernel@vger.kernel.org
Cc: schwidefsky@de.ibm.com
Subject: [PATCH] no_idle_hz (s390/xen) 2.6.16.13: fix next_timer_interrupt() when timer pending
Date: Thu, 29 Jun 2006 11:14:36 +0100 [thread overview]
Message-ID: <20060629101436.GA18542@cockermouth.uk.xensource.com> (raw)
Fix next_timer_interrupt() to return the expired timeout of any
pending timer instead of the default "nothing scheduled" timeout
value of jiffies+MAX_JIFFY_OFFSET. See comment in patch for details.
Signed-off-by: Emmanuel Ackaouy <ack@xensource.com>
diff -pruN pristine-linux-2.6.16.13/kernel/timer.c linux-2.6.16.13-xen/kernel/timer.c
--- pristine-linux-2.6.16.13/kernel/timer.c 2006-05-02 22:38:44.000000000 +0100
+++ linux-2.6.16.13-xen/kernel/timer.c 2006-06-28 21:38:58.000000000 +0100
@@ -555,7 +555,17 @@ found:
}
spin_unlock(&base->t_base.lock);
- if (time_before(hr_expires, expires))
+ /*
+ * If timers are pending, "expires" will be in the recent past
+ * of "jiffies". If there are no hr_timers registered, "hr_expires"
+ * will be "jiffies + MAX_JIFFY_OFFSET"; this is *just* short of being
+ * considered to be before "jiffies". This makes it very likely that
+ * "hr_expires" *will* be considered to be before "expires".
+ * So we must check when there are pending timers (expires <= jiffies)
+ * to ensure that we don't accidently tell the caller that there is
+ * nothing scheduled until half an epoch (MAX_JIFFY_OFFSET)!
+ */
+ if (time_before(jiffies, expires) && time_before(hr_expires, expires))
return hr_expires;
return expires;
next reply other threads:[~2006-06-29 10:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-29 10:14 Emmanuel Ackaouy [this message]
2006-06-29 10:21 ` Arjan van de Ven
2006-06-29 11:10 ` Emmanuel Ackaouy
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=20060629101436.GA18542@cockermouth.uk.xensource.com \
--to=ack@xensource.com \
--cc=linux-kernel@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
/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
all inboxes | Powered by JetHome®