All of lore.kernel.org
 help / color / mirror / Atom feed
* pvclock in userland (reprise)
@ 2009-09-17 17:58 Dan Magenheimer
  2009-09-17 19:03 ` Keir Fraser
  0 siblings, 1 reply; 14+ messages in thread
From: Dan Magenheimer @ 2009-09-17 17:58 UTC (permalink / raw)
  To: Xen-Devel (E-mail)
  Cc: Nakajima, Jun, Jeremy Fitzhardinge, Dugger, Donald D, Keir Fraser,
	Jan Beulich

Some offlist email with the Intel team may have
solved the thorniest issues for my earlier proposal
explained here:

http://lists.xensource.com/archives/html/xen-devel/2009-08/msg01209.html

The key showstoppers for this were that the pvclock
mechanism as used by a guest kernel depends on
knowing the vcpu number and fetching the proper
adjustment values which differ depending on the
vcpu.  AND even if you could get the vcpu number
and proper adjustment values, there is no way
to ensure that a context switch doesn't occur
right in the middle of the pvclock computation
that changes what values must be used.

Jun pointed out that on the majority of Intel
processors and Intel-based systems that Xen runs
on today AND the VAST majority of new Intel
and AMD systems being shipped that Xen will run on
tomorrow, TSC is "reliable", meaning it is synchronized
within a reasonable error range across all processors.

So suppose there is a single page for all processors
that contains a flag field: "TSC_is_reliable".
If TSC_is_reliable is set (by Xen), then the app can
safely use the remaining fields to compute the pvclock
algorithm.  If it is NOT set, the app must use
a much slower system call (or a somewhat-slower
yet-to-be-designed userland hypercall).

A remaining hard problem is that this single
"userland-accessible shared page" must be somehow
made available to apps (I suggested a rdmsr emulated
by Xen so that it works in userland) and must be
mapped into the app address space without kernel
changes.  I think someone (Keir?) suggested this
problem was solveable before we got sidetracked
on the need-vcpu-number-in-userland problem.

Comments?

Thanks,
Dan

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-09-21 18:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-17 17:58 pvclock in userland (reprise) Dan Magenheimer
2009-09-17 19:03 ` Keir Fraser
2009-09-17 19:13   ` Nakajima, Jun
2009-09-17 19:23     ` Keir Fraser
2009-09-17 19:24     ` Jeremy Fitzhardinge
2009-09-17 19:45       ` Dan Magenheimer
2009-09-17 20:13         ` Jeremy Fitzhardinge
2009-09-17 20:57           ` Dan Magenheimer
2009-09-18  7:29   ` Jan Beulich
2009-09-18  8:06     ` Keir Fraser
2009-09-19  0:33       ` Jeremy Fitzhardinge
2009-09-19 10:47         ` Keir Fraser
2009-09-21  8:20         ` Jan Beulich
2009-09-21 18:54           ` Jeremy Fitzhardinge

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.