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

[Xen-devel] [PATCH] RFC: Linux: disable APERF/MPERF feature in PV kernels


while testing some APERF/MPERF semantics I discovered that this feature is enabled in Xen Dom0, but is not reliable. The Linux kernel's scheduler uses this feature if it sees the CPUID bit, leading to costly RDMSR traps (a few 100,000s during a kernel compile) and bogus values due to VCPU migration during the measurement. The attached patch explicitly disables this CPU capability inside the Linux kernel, I couldn't measure any APERF/MPERF reads anymore with the patch applied. I am not sure if the PVOPS code is the right place to fix this, we could as well do it in the HV's xen/arch/x86/traps.c:pv_cpuid(). Also when the Dom0 VCPUs are pinned, we could allow this, but I am not sure if it's worth to do so.

Awaiting your comments.


P.S. Of course this doesn't fix pure userland software like cpupower, but I would consider this in the user's responsibility to not use these tools in Dom0, but instead use xenpm.

Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany

Attachment: xenpv_aperfmperf.patch
Description: xenpv_aperfmperf.patch

Xen-devel mailing list



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