[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4846F577.10603@goop.org>
Date: Wed, 04 Jun 2008 21:05:11 +0100
From: Jeremy Fitzhardinge <jeremy@...p.org>
To: Jeff Dike <jdike@...toit.com>
CC: Andrew Morton <akpm@...ux-foundation.org>, Nix <nix@...eri.org.uk>,
dhazelton@...er.net, linux-kernel@...r.kernel.org,
user-mode-linux-devel@...ts.sourceforge.net
Subject: Re: [PATCH 1/6] UML - Deal with host time going backwards
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists