|
@@ -207,11 +207,11 @@ void account_system_time(struct task_struct *p, int hardirq_offset,
|
|
* Account for involuntary wait time.
|
|
* Account for involuntary wait time.
|
|
* @cputime: the cpu time spent in involuntary wait
|
|
* @cputime: the cpu time spent in involuntary wait
|
|
*/
|
|
*/
|
|
-void account_steal_time(cputime_t cputime)
|
|
|
|
|
|
+void account_steal_time(u64 cputime)
|
|
{
|
|
{
|
|
u64 *cpustat = kcpustat_this_cpu->cpustat;
|
|
u64 *cpustat = kcpustat_this_cpu->cpustat;
|
|
|
|
|
|
- cpustat[CPUTIME_STEAL] += cputime_to_nsecs(cputime);
|
|
|
|
|
|
+ cpustat[CPUTIME_STEAL] += cputime;
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -239,14 +239,15 @@ static __always_inline cputime_t steal_account_process_time(cputime_t maxtime)
|
|
#ifdef CONFIG_PARAVIRT
|
|
#ifdef CONFIG_PARAVIRT
|
|
if (static_key_false(¶virt_steal_enabled)) {
|
|
if (static_key_false(¶virt_steal_enabled)) {
|
|
cputime_t steal_cputime;
|
|
cputime_t steal_cputime;
|
|
- u64 steal;
|
|
|
|
|
|
+ u64 steal, rounded;
|
|
|
|
|
|
steal = paravirt_steal_clock(smp_processor_id());
|
|
steal = paravirt_steal_clock(smp_processor_id());
|
|
steal -= this_rq()->prev_steal_time;
|
|
steal -= this_rq()->prev_steal_time;
|
|
|
|
|
|
steal_cputime = min(nsecs_to_cputime(steal), maxtime);
|
|
steal_cputime = min(nsecs_to_cputime(steal), maxtime);
|
|
- account_steal_time(steal_cputime);
|
|
|
|
- this_rq()->prev_steal_time += cputime_to_nsecs(steal_cputime);
|
|
|
|
|
|
+ rounded = cputime_to_nsecs(steal_cputime);
|
|
|
|
+ account_steal_time(rounded);
|
|
|
|
+ this_rq()->prev_steal_time += rounded;
|
|
|
|
|
|
return steal_cputime;
|
|
return steal_cputime;
|
|
}
|
|
}
|