public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Jeff Dike <jdike@addtoit.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Nix <nix@esperi.org.uk>,
	dhazelton@enter.net, linux-kernel@vger.kernel.org,
	user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/6] UML - Deal with host time going backwards
Date: Wed, 04 Jun 2008 21:05:11 +0100	[thread overview]
Message-ID: <4846F577.10603@goop.org> (raw)
In-Reply-To: <20080604193715.GA11943@c2.user-mode-linux.org>

Jeff Dike wrote:
> On Wed, Jun 04, 2008 at 03:31:58PM +0100, Jeremy Fitzhardinge wrote:
>   
>> Shouldn't UML use a monotonic host clock for guest timekeeping?
>>     
>
> Indeed, Eric pointed out the posix timers, which I had forgotten
> about.  On the face of it, a monotonic timer should do the trick, but
> it's not obvious how to get it to behave like a monotonic
> gettimeofday...

You can either read the monotonic clock directly, or use it as a time 
source for a monotonic timer.  clock_gettime(CLOCK_MONOTONIC, &ts) will 
return the time in ns, and you can just feed that directly into the 
guest as a clocksource.

    J

  reply	other threads:[~2008-06-04 20:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-03 19:02 [PATCH 1/6] UML - Deal with host time going backwards Jeff Dike
2008-06-03 19:32 ` Andrew Morton
2008-06-03 19:43   ` Daniel Hazelton
2008-06-03 19:52     ` Nix
2008-06-03 20:07       ` Andrew Morton
2008-06-03 20:37         ` Daniel Hazelton
2008-06-03 21:00         ` Jeff Dike
2008-06-04  1:50           ` Eric W. Biederman
2008-06-04  3:15             ` Jeff Dike
2008-06-04  5:12             ` Daniel Hazelton
2008-06-04 14:31           ` Jeremy Fitzhardinge
2008-06-04 19:37             ` Jeff Dike
2008-06-04 20:05               ` Jeremy Fitzhardinge [this message]
2008-06-05 15:30                 ` Jeff Dike
2008-06-05 18:14                   ` Nix
2008-06-05 19:47                     ` Jeff Dike
2008-06-05 21:41                       ` Nix
2008-06-05 18:19                   ` Nix
  -- strict thread matches above, loose matches on Subject: below --
2008-06-03 19:59 devzero

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=4846F577.10603@goop.org \
    --to=jeremy@goop.org \
    --cc=akpm@linux-foundation.org \
    --cc=dhazelton@enter.net \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nix@esperi.org.uk \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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