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

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


  • To: Olaf Hering <olaf@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxx
  • From: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
  • Date: Fri, 9 Mar 2018 13:59:44 -0500
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wei.liu2@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, Julien Grall <julien.grall@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Fri, 09 Mar 2018 19:00:25 +0000
  • Ironport-phdr: 9a23:7kq+jhaO/tJga+0kEWVidtX/LSx+4OfEezUN459isYplN5qZpsiybB7h7PlgxGXEQZ/co6odzbaO6OawBydZuMvJmUtBWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYdFRrlKAV6OPn+FJLMgMSrzeCy/IDYbxlViDanbr5+MBu7oR/Su8QXjoduN7s9xxvUqXZUZupawn9lK0iOlBjm/Mew+5Bj8yVUu/0/8sNLTLv3caclQ7FGFToqK2866tHluhnFVguP+2ATUn4KnRpSAgjK9w/1U5HsuSbnrOV92S2aPcrrTbAoXDmp8qlmRAP0hCoBKjU063/chNBug61HoRKhvx1/zJDSYIGJL/p1Y6fRccoHSWZdQspdUipMDY2mb4sLEuEPI+BWoYfgrFcKtBeyGxWgCObpxzRVhHH5wLc63vw8Hw/Y0gwuH9EAvnrao9r6NqgdTe+7wbLUzTjBdf5axSvx5YbKfx0nvPqCXahwcc3UyUQ3GQ3KlFOQqY37MDORy+8DvXaU5Pdh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gmtnQqzBB9KaiAylNOayuY3YzsOr3QMmTy4BGva6vN11DRztmW/L0D6PMiq1XspAupDFYt821709lJ1HuR/pvLAxQTUZ7rVkY39gV6q6/BbyYh5oPUyWdsMai7szPYx90pA+4lwA66f9hDKKOECBPyE8oCCsirMuMqgV2pYQgePO9M9645JMKmd/2Y2K6qJ+ZgnSmpjWBZ74Bh0kKM9ix8SuHT35YB2f6XxRGLWCv7jFek4YjLntVjYTgcVkqy0yniC8YFYal7c64CBH+gJ8Dxytgow9b9Vngd+FO9Clcu3M6yZQHUf1H7mwpK2hc5u3uizAexyT15l3kFo+KwxiXHzay2eBULN2FRTUF+nFzsJs6ylNlcU0+2OVt63CC57Fr3kvAI7J90KHPeFAIRJXD7
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03/09/2018 09:10 AM, 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.

Add a new domctl XEN_DOMCTL_set_vtsc_tolerance_khz to adjust the
tolerance value of a running domU that is supposed to be migrated.

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

A new utility is added which allows to adjust the vtsc_tolerance_khz
value for running domUs. This is useful to avoid emulation for domUs
that are already running and which can not be restarted.

The ordering of records sent during migration is important. The value of
vtsc_tolerance_khz must be known by the receiving host before
configuring TSC, because this is the place where the decision of vTSC
emulation is made. Therefore the existing write_tsc_info function is
modified to enforce that ordering.

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

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

Acked-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>

_______________________________________________
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®.