virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: James Morris <jmorris@namei.org>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: virtualization@lists.osdl.org
Subject: Re: [LGUEST] updated nohz/hrtimer WIP patches (v04)
Date: Thu, 29 Mar 2007 15:15:27 -0400 (EDT)	[thread overview]
Message-ID: <Line.LNX.4.64.0703291509470.14851@d.namei> (raw)
In-Reply-To: <460BED15.9040301@goop.org>

On Thu, 29 Mar 2007, Jeremy Fitzhardinge wrote:

> Two things:
> 
>    1. It's probably better to make this interface specified in absolute
>       rather than relative time.  Asking for a timeout "X ns from _now_"
>       is a bit vague if the guest can be preempted and _now_ can be
>       arbitrarily deferred.  The tricky part about using an absolute
>       time is that the guest needs to work out how to convert from a
>       guest time into hypervisor time...

Thanks for the review!

Yep, it's as simple as possible now, and absolute time something to 
investigate along with time synchronization between the host and the 
guest (which we effectively avoid at this point).

>    2. Rather than kicking the timer immediately for too-short (or
>       negative) timeouts, it should have the option to return -ETIME, to
>       match the clockevents set_next_event API.

Ok.

> +static int lguest_clockevent_set_next_event(unsigned long delta,
> +					    struct clock_event_device *evt)
> +{
> +	ktime_t kdelta = ktime_sub(evt->next_event, ktime_get());
> +	hcall(LHCALL_CLOCKEVENT, __pa(&kdelta), 0, 0);
> +	return 0;
> +}
> 
> 
> Why compute kdelta?  Why not just use "delta"?

'delta' is limited to 2^32 nanoseconds on 32-bit, which is not enough to 
be useful (I really don't understand why the API is like this).  So, 
instead, the 64-bit ktime_t delta is derived.



- James
-- 
James Morris
<jmorris@namei.org>

  reply	other threads:[~2007-03-29 19:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-26 16:11 [LGUEST] updated nohz/hrtimer WIP patches (v02) James Morris
2007-03-29 15:53 ` [LGUEST] updated nohz/hrtimer WIP patches (v04) James Morris
2007-03-29 16:45   ` Jeremy Fitzhardinge
2007-03-29 19:15     ` James Morris [this message]
2007-03-29 19:24       ` Jeremy Fitzhardinge
2007-03-30  2:08   ` Rusty Russell

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=Line.LNX.4.64.0703291509470.14851@d.namei \
    --to=jmorris@namei.org \
    --cc=jeremy@goop.org \
    --cc=virtualization@lists.osdl.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).