From: tip-bot for Christoph Lameter <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
peterz@infradead.org, cl@gentwo.org, cl@linux.com,
tglx@linutronix.de
Subject: [tip:sched/core] sched/cputime: Use this_cpu_add() in task_group_account_field()
Date: Fri, 16 Aug 2013 11:46:35 -0700 [thread overview]
Message-ID: <tip-a4f61cc03e443647211a5ae0ab8f8cda2e9e1043@git.kernel.org> (raw)
In-Reply-To: <00000140596dd165-338ff7f5-893b-4fec-b251-aaac5557239e-000000@email.amazonses.com>
Commit-ID: a4f61cc03e443647211a5ae0ab8f8cda2e9e1043
Gitweb: http://git.kernel.org/tip/a4f61cc03e443647211a5ae0ab8f8cda2e9e1043
Author: Christoph Lameter <cl@gentwo.org>
AuthorDate: Wed, 7 Aug 2013 15:38:24 +0000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 16 Aug 2013 17:44:29 +0200
sched/cputime: Use this_cpu_add() in task_group_account_field()
Use of a this_cpu() operation reduces the number of instructions used
for accounting (account_user_time()) and frees up some registers. This is in
the scheduler tick hotpath.
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/00000140596dd165-338ff7f5-893b-4fec-b251-aaac5557239e-000000@email.amazonses.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/cputime.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index a7959e0..e89ccef 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -121,7 +121,7 @@ static inline void task_group_account_field(struct task_struct *p, int index,
* is the only cgroup, then nothing else should be necessary.
*
*/
- __get_cpu_var(kernel_cpustat).cpustat[index] += tmp;
+ __this_cpu_add(kernel_cpustat.cpustat[index], tmp);
cpuacct_account_field(p, index, tmp);
}
parent reply other threads:[~2013-08-16 18:47 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <00000140596dd165-338ff7f5-893b-4fec-b251-aaac5557239e-000000@email.amazonses.com>]
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-a4f61cc03e443647211a5ae0ab8f8cda2e9e1043@git.kernel.org \
--to=tipbot@zytor.com \
--cc=cl@gentwo.org \
--cc=cl@linux.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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