Skip to content

Commit 26f2c75

Browse files
fweisbecIngo Molnar
authored andcommitted
sched/cputime: Fix omitted ticks passed in parameter
Commit: f9bcf1e ("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. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Acked-by: Wanpeng Li <kernellwp@gmail.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: Wanpeng Li <wanpeng.li@hotmail.com> Cc: linux-tip-commits@vger.kernel.org Link: http://lkml.kernel.org/r/20160811125822.GB4214@lerouge Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent f9bcf1e commit 26f2c75

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/sched/cputime.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,12 +509,13 @@ void account_process_tick(struct task_struct *p, int user_tick)
509509
void account_idle_ticks(unsigned long ticks)
510510
{
511511
cputime_t cputime, steal;
512+
512513
if (sched_clock_irqtime) {
513514
irqtime_account_idle_ticks(ticks);
514515
return;
515516
}
516517

517-
cputime = cputime_one_jiffy;
518+
cputime = jiffies_to_cputime(ticks);
518519
steal = steal_account_process_time(cputime);
519520

520521
if (steal >= cputime)

0 commit comments

Comments
 (0)