lkml.org 
[lkml]   [2006]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH 01/13] hrtimer: round up relative start time
From
Date
On Mon, 2006-02-13 at 02:09 +0100, Roman Zippel wrote:
> When starting a relative timer we have to round it up the next clock
> tick to avoid an early expiry. The problem is that we don't know the
> real clock resolution, so we have to assume the worst case, but it's
> basically the same as the old code did, so it won't be worse than 2.6.15
> and with a better clock interface we can improve this.
>
> Signed-off-by: Roman Zippel <zippel@linux-m68k.org>

NACK

This adds an artificial offset to the expiry time, for what reason? The
expiry code makes sure that timers can not expire early. See:

timer = rb_entry(node, struct hrtimer, node);
if (now.tv64 <= timer->expires.tv64)
break;

in kernel/hrtimers.c:run_hrtimer_queue(), where now is already tick
aligned.

Please provide a testcase (or detailed use-case) which proves that this
is necessary.

tglx

> ---
>
> kernel/hrtimer.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Index: linux-2.6-git/kernel/hrtimer.c
> ===================================================================
> --- linux-2.6-git.orig/kernel/hrtimer.c 2006-02-12 18:32:48.000000000 +0100
> +++ linux-2.6-git/kernel/hrtimer.c 2006-02-12 18:32:57.000000000 +0100
> @@ -419,7 +419,8 @@ hrtimer_start(struct hrtimer *timer, kti
> new_base = switch_hrtimer_base(timer, base);
>
> if (mode == HRTIMER_REL)
> - tim = ktime_add(tim, new_base->get_time());
> + tim = ktime_add(ktime_add(tim, new_base->get_time()),
> + base->resolution);
> timer->expires = tim;
>
> enqueue_hrtimer(timer, new_base);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-13 11:54    [W:0.146 / U:0.936 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site