From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@kernel.org>
Subject: [patch 3/5] hrtimer: Document hrtimer_forward[_now]() proper
Date: Mon, 13 Apr 2015 21:02:22 -0000 [thread overview]
Message-ID: <20150413210035.178751779@linutronix.de> (raw)
In-Reply-To: 20150413210009.682000343@linutronix.de
[-- Attachment #1: hrtimer-document-hrtimer-forward-now.patch --]
[-- Type: text/plain, Size: 2062 bytes --]
Document the calling context conditions.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/hrtimer.h | 17 ++++++++++++++++-
kernel/time/hrtimer.c | 8 ++++++++
2 files changed, 24 insertions(+), 1 deletion(-)
Index: linux/include/linux/hrtimer.h
===================================================================
--- linux.orig/include/linux/hrtimer.h
+++ linux/include/linux/hrtimer.h
@@ -418,7 +418,22 @@ static inline int hrtimer_callback_runni
extern u64
hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
-/* Forward a hrtimer so it expires after the hrtimer's current now */
+/**
+ * hrtimer_forward_now - forward the timer expiry so it expires after now
+ * @timer: hrtimer to forward
+ * @interval: the interval to forward
+ *
+ * Forward the timer expiry so it will expire after the current time
+ * of the hrtimer clock base. Returns the number of overruns.
+ *
+ * Can be safely called from the callback function of @timer. If
+ * called from other contexts @timer must neither be enqueued nor
+ * running the callback and the caller needs to take care of
+ * serialization.
+ *
+ * Note: This only updates the timer expiry value and does not requeue
+ * the timer.
+ */
static inline u64 hrtimer_forward_now(struct hrtimer *timer,
ktime_t interval)
{
Index: linux/kernel/time/hrtimer.c
===================================================================
--- linux.orig/kernel/time/hrtimer.c
+++ linux/kernel/time/hrtimer.c
@@ -801,6 +801,14 @@ void unlock_hrtimer_base(const struct hr
*
* Forward the timer expiry so it will expire in the future.
* Returns the number of overruns.
+ *
+ * Can be safely called from the callback function of @timer. If
+ * called from other contexts @timer must neither be enqueued nor
+ * running the callback and the caller needs to take care of
+ * serialization.
+ *
+ * Note: This only updates the timer expiry value and does not requeue
+ * the timer.
*/
u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval)
{
next prev parent reply other threads:[~2015-04-13 21:03 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-13 21:02 [patch 0/5] hrtimer: Cleanup usage trainwrecks treewide Thomas Gleixner
2015-04-13 21:02 ` [patch 1/5] perf: Fixup hrtimer forward wreckage Thomas Gleixner
2015-04-14 22:10 ` Stephane Eranian
2015-04-13 21:02 ` [patch 2/5] s390: crypto: Protect poll timeout update Thomas Gleixner
2015-04-17 13:27 ` Ingo Tuchscherer
2015-04-13 21:02 ` Thomas Gleixner [this message]
2015-04-22 19:04 ` [tip:timers/core] hrtimer: Document hrtimer_forward[_now]() proper tip-bot for Thomas Gleixner
2015-04-13 21:02 ` [patch 4/5] net: hip04: Make tx coalesce timer actually work Thomas Gleixner
2015-04-13 21:24 ` Arnd Bergmann
2015-04-13 21:42 ` Thomas Gleixner
2015-04-13 22:03 ` Arnd Bergmann
2015-04-13 22:08 ` Thomas Gleixner
2015-04-14 7:53 ` Ding Tianhong
2015-04-14 18:15 ` David Miller
2015-04-14 19:42 ` [patch v2] " Thomas Gleixner
2015-04-15 2:24 ` Ding Tianhong
2015-04-15 10:20 ` Arnd Bergmann
2015-04-15 21:22 ` David Miller
2015-04-13 21:02 ` [patch 5/5] staging: ozwpan: Fix hrtimer wreckage Thomas Gleixner
2015-04-13 21:25 ` Greg Kroah-Hartman
2015-07-20 9:40 ` [tip:timers/core] " tip-bot for 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=20150413210035.178751779@linutronix.de \
--to=tglx@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).