mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 1/4] new timerfd API v2 - introduce a new hrtimer_forward_now() function
@ 2007-09-24 20:22 Davide Libenzi
  2007-09-24 20:28 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Davide Libenzi @ 2007-09-24 20:22 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Michael Kerrisk, Thomas Gleixner, Andrew Morton, Linus Torvalds

I think that advancing the timer against the timer's current "now" can
be a pretty common usage, so, w/out exposing hrtimer's internals, we add
a new hrtimer_forward_now() function.



Signed-off-by: Davide Libenzi <davidel@xmailserver.org>


- Davide


---
 include/linux/hrtimer.h |    7 +++++++
 1 file changed, 7 insertions(+)

Index: linux-2.6.mod/include/linux/hrtimer.h
===================================================================
--- linux-2.6.mod.orig/include/linux/hrtimer.h	2007-09-24 12:27:20.000000000 -0700
+++ linux-2.6.mod/include/linux/hrtimer.h	2007-09-24 12:29:39.000000000 -0700
@@ -298,6 +298,13 @@
 extern unsigned long
 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
 
+/* Forward a hrtimer so it expires after the hrtimer's current now */
+static inline unsigned long hrtimer_forward_now(struct hrtimer *timer,
+						ktime_t interval)
+{
+	return hrtimer_forward(timer, timer->base->get_time(), interval);
+}
+
 /* Precise sleep: */
 extern long hrtimer_nanosleep(struct timespec *rqtp,
 			      struct timespec __user *rmtp,


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 1/4] new timerfd API v2 - introduce a new hrtimer_forward_now() function
  2007-09-24 20:22 [patch 1/4] new timerfd API v2 - introduce a new hrtimer_forward_now() function Davide Libenzi
@ 2007-09-24 20:28 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2007-09-24 20:28 UTC (permalink / raw)
  To: Davide Libenzi
  Cc: Linux Kernel Mailing List, Michael Kerrisk, Andrew Morton,
	Linus Torvalds


On Mon, 2007-09-24 at 13:22 -0700, Davide Libenzi wrote:
> I think that advancing the timer against the timer's current "now" can
> be a pretty common usage, so, w/out exposing hrtimer's internals, we add
> a new hrtimer_forward_now() function.
> 
> 
> 
> Signed-off-by: Davide Libenzi <davidel@xmailserver.org>

Reviewed-and-Acked-by: Thomas Gleixner <tglx@linutronix.de>

> 
> - Davide
> 
> 
> ---
>  include/linux/hrtimer.h |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> Index: linux-2.6.mod/include/linux/hrtimer.h
> ===================================================================
> --- linux-2.6.mod.orig/include/linux/hrtimer.h	2007-09-24 12:27:20.000000000 -0700
> +++ linux-2.6.mod/include/linux/hrtimer.h	2007-09-24 12:29:39.000000000 -0700
> @@ -298,6 +298,13 @@
>  extern unsigned long
>  hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
>  
> +/* Forward a hrtimer so it expires after the hrtimer's current now */
> +static inline unsigned long hrtimer_forward_now(struct hrtimer *timer,
> +						ktime_t interval)
> +{
> +	return hrtimer_forward(timer, timer->base->get_time(), interval);
> +}
> +
>  /* Precise sleep: */
>  extern long hrtimer_nanosleep(struct timespec *rqtp,
>  			      struct timespec __user *rmtp,
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-24 20:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-24 20:22 [patch 1/4] new timerfd API v2 - introduce a new hrtimer_forward_now() function Davide Libenzi
2007-09-24 20:28 ` Thomas Gleixner

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®