Skip to content

Commit

Permalink
sched/cputime: Fix omitted ticks passed in parameter
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Wanpeng Li <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Radim <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Wanpeng Li <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/20160811125822.GB4214@lerouge
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
fweisbec authored and Ingo Molnar committed Aug 11, 2016
1 parent f9bcf1e commit 26f2c75
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/sched/cputime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 26f2c75

Please sign in to comment.