[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v7] new config option vtsc_tolerance_khz to avoid TSC emulation



On Sun, Apr 01, 2018 at 07:03:18PM +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.

Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>

> 
> v7:
>  - use uint16 in libxl_types.idl to match type used elsewhere in the patch
> v6:
>  - mention default value in xl.cfg
>  - tsc_set_info: remove usage of __func__, use %d for domid
>  - tsc_set_info: use ABS to calculate khz_diff
> v5:
>  - reduce functionality to allow setting of the tolerance value
>    only at initial domU startup
> v4:
>  - add missing copyback in XEN_DOMCTL_set_vtsc_tolerance_khz
> v3:
>  - rename vtsc_khz_tolerance to vtsc_tolerance_khz
>  - separate domctls to adjust values
>  - more docs
>  - update libxl.h
>  - update python tests
>  - flask check bound to tsc permissions
>  - not runtime tested due to dlsym() build errors in staging

Please place revision information below "---" so that it can be trimmed
automatically by git.

> 
> Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
> ---
>  docs/man/xen-tscmode.pod.7               | 16 ++++++++++++++++
>  docs/man/xl.cfg.pod.5.in                 | 10 ++++++++++
>  docs/specs/libxc-migration-stream.pandoc |  6 ++++--
>  tools/libxc/include/xenctrl.h            |  2 ++
>  tools/libxc/xc_domain.c                  |  4 ++++
>  tools/libxc/xc_sr_common_x86.c           |  6 ++++--
>  tools/libxc/xc_sr_stream_format.h        |  3 ++-
>  tools/libxl/libxl.h                      |  6 ++++++
>  tools/libxl/libxl_types.idl              |  1 +
>  tools/libxl/libxl_x86.c                  |  3 ++-
>  tools/python/xen/lowlevel/xc/xc.c        |  2 +-

Marek, this needs your ack. It is just a adapting existing code to new
prototype so it should be fine.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.