mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
sched/cputime: Fix omitted ticks passed in parameter
Commit:
f9bcf1e0e0
("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>
This commit is contained in:
parent
f9bcf1e0e0
commit
26f2c75cd2
1 changed files with 2 additions and 1 deletions
|
@ -509,12 +509,13 @@ void account_process_tick(struct task_struct *p, int user_tick)
|
||||||
void account_idle_ticks(unsigned long ticks)
|
void account_idle_ticks(unsigned long ticks)
|
||||||
{
|
{
|
||||||
cputime_t cputime, steal;
|
cputime_t cputime, steal;
|
||||||
|
|
||||||
if (sched_clock_irqtime) {
|
if (sched_clock_irqtime) {
|
||||||
irqtime_account_idle_ticks(ticks);
|
irqtime_account_idle_ticks(ticks);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cputime = cputime_one_jiffy;
|
cputime = jiffies_to_cputime(ticks);
|
||||||
steal = steal_account_process_time(cputime);
|
steal = steal_account_process_time(cputime);
|
||||||
|
|
||||||
if (steal >= cputime)
|
if (steal >= cputime)
|
||||||
|
|
Loading…
Reference in a new issue