public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 01/13] hrtimer: round up relative start time
Date: Mon, 13 Feb 2006 10:52:07 +0000	[thread overview]
Message-ID: <1139827927.4932.17.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.61.0602130207560.23745@scrub.home>

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);


  reply	other threads:[~2006-02-13 10:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-13  1:09 [PATCH 01/13] hrtimer: round up relative start time Roman Zippel
2006-02-13 10:52 ` Thomas Gleixner [this message]
2006-02-13 11:25   ` Roman Zippel
2006-02-13 13:01     ` Ingo Molnar
2006-02-13 13:42       ` Roman Zippel
2006-02-13 14:44         ` Ingo Molnar
2006-02-13 15:49           ` Roman Zippel
2006-02-13 19:55             ` Ingo Molnar
2006-02-13 22:29               ` Roman Zippel
2006-02-14  7:41     ` Ingo Molnar
2006-02-14 10:18       ` Roman Zippel
2006-02-14 12:20         ` [patch] hrtimer: round up relative start time on low-res arches Ingo Molnar
2006-02-14 21:51           ` Thomas Gleixner
2006-02-15  0:30           ` Roman Zippel
2006-02-15  9:19             ` Ingo Molnar
2006-02-15 12:26               ` Roman Zippel
2006-02-15 20:43                 ` john stultz
2006-02-16 14:10                   ` Roman Zippel
2006-02-16 19:06                     ` john stultz
2006-02-16 23:44                       ` Roman Zippel
2006-02-17  0:28                         ` john stultz
2006-02-17 15:02                           ` Roman Zippel
2006-02-14 10:26       ` [PATCH 01/13] hrtimer: round up relative start time 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=1139827927.4932.17.camel@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=zippel@linux-m68k.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