xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Physical hot-add cpus and TSC
@ 2010-05-26 15:19 Dan Magenheimer
  2010-05-26 15:45 ` Keir Fraser
  0 siblings, 1 reply; 39+ messages in thread
From: Dan Magenheimer @ 2010-05-26 15:19 UTC (permalink / raw)
  To: Xen-Devel (xen-devel@lists.xensource.com)

I thought I should bring this up now rather than
wait until the problem causes problems for some
future customer...

Much of the TSC-based time infrastructure in Xen,
especially as exposed to guests, is rather sensitive
to sudden dramatic differences in TSC values between
physical processors.  Hot-add of physical CPUs will
introduce a huge difference.

Current code attempts to "fix up" TSC after discontinuity
events (such as C3-state) but this works poorly (far
too imprecise), so all guest TSC uses are always emulated
on any physical machine that might have such discontinuities.

Even though a very small percentage of real-world machines
will be capable of hot-cpu-add -- and an even smaller
percentage of real-world machines will ever actually
hot-add a cpu -- Xen 4.0 currently detects and
allows this operation.  As a result, it is currently
impossible to predict if a hot-add might happen and result
in a TSC discontinuity.

Some possible solutions:
1) Always emulate all TSC uses for all guests because
   there is a (microscopic?) probability that a physical
   hot-cpu-add event might occur
2) Disable hot-cpu-add by default in Xen and require a
   Xen boot parameter to be specified if a machine might
   possibly do a hot-cpu-add.  If this boot parameter is
   specified, see (1) above.
3) Do a very precise TSC fixup on a hot-add cpu before it
   is recognized by Xen as present.  (Not sure if this is
   possible.)
4) Dynamically switch to TSC emulation on all guests
   when a hot-cpu-add event occurs.  (Problem:  Under
   certain circumstances, the Invariant TSC bit is
   enabled for some guests which maximizes performance
   on newer Linux kernels.  This choice would require
   Invariant TSC to always be zero.)

Thoughts?  (My favorite is (2))

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

end of thread, other threads:[~2010-06-10 13:15 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26 15:19 [RFC] Physical hot-add cpus and TSC Dan Magenheimer
2010-05-26 15:45 ` Keir Fraser
2010-05-26 16:44   ` Dan Magenheimer
2010-05-26 17:02     ` Ian Pratt
2010-05-26 17:29     ` Keir Fraser
2010-05-26 17:39       ` Dan Magenheimer
2010-05-26 17:51         ` Keir Fraser
2010-05-26 18:01         ` Keir Fraser
2010-05-26 19:46           ` Dan Magenheimer
2010-05-26 21:26             ` Keir Fraser
2010-05-27  6:15               ` Jiang, Yunhong
2010-05-27  6:57                 ` Keir Fraser
2010-05-27  7:09                   ` Jiang, Yunhong
2010-05-27  7:15                   ` Jiang, Yunhong
2010-05-27 19:55                     ` Dan Magenheimer
2010-05-27  8:44                 ` Keir Fraser
2010-05-27  9:31                   ` Jiang, Yunhong
2010-05-27 15:08                     ` Dan Magenheimer
2010-05-28  5:39                       ` Jiang, Yunhong
2010-05-28  5:47                         ` Keir Fraser
2010-05-28  6:29                           ` Jiang, Yunhong
2010-05-28  7:03                             ` Keir Fraser
2010-05-28 14:35                               ` Dan Magenheimer
2010-05-28 15:33                                 ` Jiang, Yunhong
2010-05-28 16:25                                   ` Dan Magenheimer
2010-05-31  8:56                                     ` Jiang, Yunhong
2010-05-28 16:08                                 ` Keir Fraser
2010-05-28 16:36                                   ` Dan Magenheimer
2010-05-28 17:19                                     ` Keir Fraser
2010-05-28 14:52                         ` Dan Magenheimer
2010-05-28 15:05                           ` Jiang, Yunhong
2010-05-28 20:24                             ` Dan Magenheimer
2010-05-31  7:54                               ` Jiang, Yunhong
2010-06-01  0:30                                 ` Dan Magenheimer
2010-06-01  1:40                                   ` Jiang, Yunhong
2010-06-01 17:07                                   ` Jeremy Fitzhardinge
2010-06-02  9:17                                     ` Jiang, Yunhong
2010-06-10  6:55                         ` Dong, Eddie
2010-06-10 13:15                           ` Dan Magenheimer

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).