lkml.org 
[lkml]   [2016]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] cputime: Fix omitted ticks passed in parameter (was: Re: [tip:sched/urgent] sched/cputime: Fix steal time accounting)
Commit f9bcf1e0e0145323ba2cf72ecad5264ff3883eb1
("sched/cputime: Fix steal time accounting") fixes a leak on steal time
accounting but forgets to account the ticks passed in parameters,
assuming there is only one to take into account.

Let's consider that parameter back.

Cc: Wanpeng Li <wanpeng.li@hotmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Radim <rkrcmar@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
kernel/sched/cputime.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index 8b9bcc5..9858266 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -509,12 +509,13 @@ void account_process_tick(struct task_struct *p, int user_tick)
void account_idle_ticks(unsigned long ticks)
{
cputime_t cputime, steal;
+
if (sched_clock_irqtime) {
irqtime_account_idle_ticks(ticks);
return;
}

- cputime = cputime_one_jiffy;
+ cputime = jiffies_to_cputime(ticks);
steal = steal_account_process_time(cputime);

if (steal >= cputime)
--
2.7.0
\
 
 \ /
  Last update: 2016-08-11 15:41    [W:0.048 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site