mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Frederic Weisbecker <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: torvalds@linux-foundation.org, pbonzini@redhat.com,
	mingo@kernel.org, kernellwp@gmail.com, hpa@zytor.com,
	riel@redhat.com, linux-kernel@vger.kernel.org,
	peterz@infradead.org, rkrcmar@redhat.com, fweisbec@gmail.com,
	wanpeng.li@hotmail.com, tglx@linutronix.de
Subject: [tip:sched/urgent] sched/cputime: Fix omitted ticks passed in parameter
Date: Thu, 11 Aug 2016 09:20:40 -0700	[thread overview]
Message-ID: <tip-26f2c75cd2cf10a6120ef02ca9a94db77cc9c8e0@git.kernel.org> (raw)
In-Reply-To: <20160811125822.GB4214@lerouge>

Commit-ID:  26f2c75cd2cf10a6120ef02ca9a94db77cc9c8e0
Gitweb:     http://git.kernel.org/tip/26f2c75cd2cf10a6120ef02ca9a94db77cc9c8e0
Author:     Frederic Weisbecker <fweisbec@gmail.com>
AuthorDate: Thu, 11 Aug 2016 14:58:24 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 11 Aug 2016 16:34:37 +0200

sched/cputime: Fix omitted ticks passed in parameter

Commit:

  f9bcf1e0e014 ("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>
---
 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)

      parent reply	other threads:[~2016-08-11 16:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11  5:36 [PATCH] sched/cputime: Fix fold steal time into idle time accounting Wanpeng Li
2016-08-11 11:56 ` [tip:sched/urgent] sched/cputime: Fix steal " tip-bot for Wanpeng Li
2016-08-11 12:58   ` [PATCH] cputime: Fix omitted ticks passed in parameter (was: Re: [tip:sched/urgent] sched/cputime: Fix steal time accounting) Frederic Weisbecker
2016-08-11 13:06     ` Wanpeng Li
2016-08-11 16:20     ` tip-bot for Frederic Weisbecker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-26f2c75cd2cf10a6120ef02ca9a94db77cc9c8e0@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=kernellwp@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=wanpeng.li@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome