Skip to content

Commit e73a8f3

Browse files
Alexey Makhalovsuryasaimadhu
authored andcommitted
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 <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent ab02bb3 commit e73a8f3

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3174,7 +3174,7 @@
31743174
[X86,PV_OPS] Disable paravirtualized VMware scheduler
31753175
clock and use the default one.
31763176

3177-
no-steal-acc [X86,KVM,ARM64] Disable paravirtualized steal time
3177+
no-steal-acc [X86,PV_OPS,ARM64] Disable paravirtualized steal time
31783178
accounting. steal time is computed, but won't
31793179
influence scheduler behaviour
31803180

arch/x86/kernel/cpu/vmware.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ static struct cyc2ns_data vmware_cyc2ns __ro_after_init;
125125
static int vmw_sched_clock __initdata = 1;
126126
static DEFINE_PER_CPU_DECRYPTED(struct vmware_steal_time, vmw_steal_time) __aligned(64);
127127
static bool has_steal_clock;
128+
static bool steal_acc __initdata = true; /* steal time accounting */
128129

129130
static __init int setup_vmw_sched_clock(char *s)
130131
{
@@ -133,6 +134,13 @@ static __init int setup_vmw_sched_clock(char *s)
133134
}
134135
early_param("no-vmw-sched-clock", setup_vmw_sched_clock);
135136

137+
static __init int parse_no_stealacc(char *arg)
138+
{
139+
steal_acc = false;
140+
return 0;
141+
}
142+
early_param("no-steal-acc", parse_no_stealacc);
143+
136144
static unsigned long long notrace vmware_sched_clock(void)
137145
{
138146
unsigned long long ns;
@@ -306,8 +314,11 @@ static int vmware_cpu_down_prepare(unsigned int cpu)
306314

307315
static __init int activate_jump_labels(void)
308316
{
309-
if (has_steal_clock)
317+
if (has_steal_clock) {
310318
static_key_slow_inc(&paravirt_steal_enabled);
319+
if (steal_acc)
320+
static_key_slow_inc(&paravirt_steal_rq_enabled);
321+
}
311322

312323
return 0;
313324
}

0 commit comments

Comments
 (0)