[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v5] new config option vtsc_tolerance_khz to avoid TSC emulation
On Wed, Mar 28, 2018 at 05:49:28PM +0100, George Dunlap wrote: > On 03/28/2018 05:27 PM, Wei Liu wrote: > > On Tue, Mar 27, 2018 at 11:26:55AM +0200, Olaf Hering wrote: > >> Add an option to control when vTSC emulation will be activated for a > >> domU with tsc_mode=default. Without such option each TSC access from > >> domU will be emulated, which causes a significant perfomance drop for > >> workloads that make use of rdtsc. > >> > >> One option to avoid the TSC option is to run domUs with tsc_mode=native. > >> This has the drawback that migrating a domU from a "2.3GHz" class host > >> to a "2.4GHz" class host may change the rate at wich the TSC counter > >> increases, the domU may not be prepared for that. > >> > >> With the new option the host admin can decide how a domU should behave > >> when it is migrated across systems of the same class. Since there is > >> always some jitter when Xen calibrates the cpu_khz value, all hosts of > >> the same class will most likely have slightly different values. As a > >> result vTSC emulation is unavoidable. Data collected during the incident > >> which triggered this change showed a jitter of up to 200 KHz across > >> systems of the same class. > >> > >> Existing padding fields are reused to store vtsc_khz_tolerance as u16. > >> > > [...] > >> index 2c1a6e1422..0b36265e4f 100644 > >> --- a/docs/man/xl.cfg.pod.5.in > >> +++ b/docs/man/xl.cfg.pod.5.in > >> @@ -1891,6 +1891,16 @@ determined in a similar way to that of B<default> > >> TSC mode. > >> > >> Please see B<xen-tscmode(7)> for more information on this option. > >> > >> +=item B<vtsc_tolerance_khz="KHZ"> > >> + > >> +B<(x86 only, relevant only for tsc_mode=default)> > >> +When a domU is started, the CPU frequency of the host is used by the domU > >> for > >> +TSC related time measurement. Once the domU is either migrated or > >> +saved/restored on another host that CPU frequency has to be emulated to > >> avoid > >> +timedrift. To avoid the performance penalty of the TSC emulation, allow a > >> +certain amount of jitter of the measured CPU frequency on the hosts the > >> domU > >> +is supposed to run on. > > > > "Default value is 0, i.e. no tolerance". > > > > Can we get an agreement on whether this idea the right approach in > > general before I do detail review? > > I'm not super-familiar with this area, but looking from the outside I > think Olaf's approach (having a "tolerance" for equivalence) makes > sense. Can't comment on what kind of a hypercall it should be. > I have a rough idea how the code should look like -- the patch in its current form looks mostly OK, but not sure if this approach in general is future proof. Wei. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |