On Wed, Nov 14, 2018 at 10:19 AM Nadav Har'El <n...@scylladb.com> wrote:

>
> On Tue, Oct 23, 2018 at 2:47 AM Rick Payne <ri...@rossfell.co.uk> wrote:
> *Glauber*, I'd love to get your opinion about this patch. Clearly our
> original assumption that we can only call the wallclock MSR once, was
> wrong. If I understand correctly, Linux guest does the same thing as this
> patch - use the wallclock MSR every time the wall clock is required - so
> this patch is the right way to go. But isn't this slow, and perhaps
> pointless, to call this MSR every time the wall clock is needed? Was this
> the intention when the pv clock ABI was designed?
>

So, I consulted with Glauber in private, and his opinion was that as I
noted later in this thread - Linux actually does *not* do what this patch
does (write the wallclock MSR every time the wallclock is read). Glauber
said that I was rightly worried that the approach in this patch - doing the
MSR  on every wall clock read is is too costly (remember that every MSR
write requires an exit to the hypervisor)

A much more efficient approach could be to run this MSR every once in a
while (e.g., once each second). One possibility could be to have a thread
(or re-use some existing system thread) which periodically refreshes the
wallclock offset. Another possibility is to have the wallclock function
check if enough monotonic has passed since the last wallclock offset
refresh, and if enough time has passed (remember to check in a thread-safe
way!), refresh it. Each of these approaches has ugly sides, so I wonder
what Linux does for this. Would be great if you or someone could try to
understand what a Linux guest does here.

Nadav.

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to