From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH v3 3/3] powerpc/time: no steal_time if !CONFIG_PPC_SPLPAR
Date: Tue, 29 May 2018 16:19:18 +0000 (UTC) [thread overview]
Message-ID: <96d2828025d815e91e3946f6ef45a09d9a206ca3.1527610536.git.christophe.leroy@c-s.fr> (raw)
In-Reply-To: <2e937890abac10677aae3c1e345dd934a6794c37.1527610536.git.christophe.leroy@c-s.fr>
If CONFIG_PPC_SPLPAR is not selected, steal_time will always
be NUL, so accounting it is pointless
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
New in v3
arch/powerpc/kernel/time.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 7d6040233003..85d1b1ff45f3 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -346,7 +346,8 @@ void vtime_account_system(struct task_struct *tsk)
stime = vtime_delta(tsk, &stime_scaled, &steal_time);
stime -= min(stime, steal_time);
- acct->steal_time += steal_time;
+ if (IS_ENABLED(CONFIG_PPC_SPLPAR))
+ acct->steal_time += steal_time;
if ((tsk->flags & PF_VCPU) && !irq_count()) {
acct->gtime += stime;
@@ -401,7 +402,7 @@ void vtime_flush(struct task_struct *tsk)
if (acct->gtime)
account_guest_time(tsk, cputime_to_nsecs(acct->gtime));
- if (acct->steal_time)
+ if (IS_ENABLED(CONFIG_PPC_SPLPAR) && acct->steal_time)
account_steal_time(cputime_to_nsecs(acct->steal_time));
if (acct->idle_time)
@@ -425,7 +426,8 @@ void vtime_flush(struct task_struct *tsk)
acct->stime_scaled = 0;
#endif
acct->gtime = 0;
- acct->steal_time = 0;
+ if (IS_ENABLED(CONFIG_PPC_SPLPAR))
+ acct->steal_time = 0;
acct->idle_time = 0;
acct->stime = 0;
acct->hardirq_time = 0;
--
2.13.3
next prev parent reply other threads:[~2018-05-29 16:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-29 16:19 [PATCH v3 1/3] powerpc/time: inline arch_vtime_task_switch() Christophe Leroy
2018-05-29 16:19 ` [PATCH v3 2/3] powerpc/time: Only set ARCH_HAS_SCALED_CPUTIME on PPC64 Christophe Leroy
2018-05-29 16:19 ` Christophe Leroy [this message]
2018-06-04 14:11 ` [v3,1/3] powerpc/time: inline arch_vtime_task_switch() Michael Ellerman
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=96d2828025d815e91e3946f6ef45a09d9a206ca3.1527610536.git.christophe.leroy@c-s.fr \
--to=christophe.leroy@c-s.fr \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
/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;
as well as URLs for NNTP newsgroup(s).