summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlexey Makhalov <amakhalov@vmware.com>2020-03-23 19:57:06 +0000
committerBorislav Petkov <bp@suse.de>2020-03-24 10:06:27 +0100
commite73a8f38f82dd1c41b70a06556bea7dc250cc384 (patch)
tree68b53dcbde74788f222451c5dc27ca96b9209c4b /arch
parentab02bb3f55f58e7608a88188000c3353398ebe3b (diff)
downloadlinux-e73a8f38f82dd1c41b70a06556bea7dc250cc384.tar.gz
linux-e73a8f38f82dd1c41b70a06556bea7dc250cc384.tar.bz2
linux-e73a8f38f82dd1c41b70a06556bea7dc250cc384.zip
x86/vmware: Enable steal time accounting
Set paravirt_steal_rq_enabled if steal clock present. paravirt_steal_rq_enabled is used in sched/core.c to adjust task progress by offsetting stolen time. Use 'no-steal-acc' off switch (share same name with KVM) to disable steal time accounting. Signed-off-by: Alexey Makhalov <amakhalov@vmware.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200323195707.31242-5-amakhalov@vmware.com
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/cpu/vmware.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index cc604614f0ae..e885f73bebd4 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -125,6 +125,7 @@ static struct cyc2ns_data vmware_cyc2ns __ro_after_init;
static int vmw_sched_clock __initdata = 1;
static DEFINE_PER_CPU_DECRYPTED(struct vmware_steal_time, vmw_steal_time) __aligned(64);
static bool has_steal_clock;
+static bool steal_acc __initdata = true; /* steal time accounting */
static __init int setup_vmw_sched_clock(char *s)
{
@@ -133,6 +134,13 @@ static __init int setup_vmw_sched_clock(char *s)
}
early_param("no-vmw-sched-clock", setup_vmw_sched_clock);
+static __init int parse_no_stealacc(char *arg)
+{
+ steal_acc = false;
+ return 0;
+}
+early_param("no-steal-acc", parse_no_stealacc);
+
static unsigned long long notrace vmware_sched_clock(void)
{
unsigned long long ns;
@@ -306,8 +314,11 @@ static int vmware_cpu_down_prepare(unsigned int cpu)
static __init int activate_jump_labels(void)
{
- if (has_steal_clock)
+ if (has_steal_clock) {
static_key_slow_inc(&paravirt_steal_enabled);
+ if (steal_acc)
+ static_key_slow_inc(&paravirt_steal_rq_enabled);
+ }
return 0;
}