Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1273242 > unrolled thread
| Started by | Frederic Weisbecker <fweisbec@gmail.com> |
|---|---|
| First post | 2015-11-19 17:00 +0100 |
| Last post | 2015-11-19 17:00 +0100 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/7] cputime: A few tickless cputime accounting fixes and improvements Frederic Weisbecker <fweisbec@gmail.com> - 2015-11-19 17:00 +0100
[PATCH 2/7] cputime: Remove extra cost in task_cputime Frederic Weisbecker <fweisbec@gmail.com> - 2015-11-19 17:00 +0100
| From | Frederic Weisbecker <fweisbec@gmail.com> |
|---|---|
| Date | 2015-11-19 17:00 +0100 |
| Subject | [PATCH 0/7] cputime: A few tickless cputime accounting fixes and improvements |
| Message-ID | <qwzDb-2M9-9@gated-at.bofh.it> |
The first two patches from Hiroshi Shimamoto are fixes to be backported.
Although it's debatable whether the 2nd patch needs backport.
The patches that follow are further fixes and cleanups and the last
one is an optimization.
git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
cputime/fixes
HEAD: e4b430e6598cf6e069b08d7a81ee2ca75fe385f2
Thanks,
Frederic
---
Frederic Weisbecker (5):
cputime: Clarify vtime symbols and document them
cputime: Correctly handle task guest time on housekeepers
cputime: Rename vtime_accounting_enabled to vtime_accounting_cpu_enabled
cputime: Introduce vtime accounting check for readers
cputime: Convert vtime_seqlock to seqcount
Hiroshi Shimamoto (2):
cputime: Fix invalid gtime in proc
cputime: Remove extra cost in task_cputime
include/linux/context_tracking.h | 4 +--
include/linux/init_task.h | 2 +-
include/linux/sched.h | 7 ++--
include/linux/vtime.h | 25 ++++++++++----
kernel/fork.c | 4 +--
kernel/sched/cputime.c | 75 +++++++++++++++++++++++++---------------
kernel/time/tick-sched.c | 2 +-
7 files changed, 77 insertions(+), 42 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Frederic Weisbecker <fweisbec@gmail.com> |
|---|---|
| Date | 2015-11-19 17:00 +0100 |
| Subject | [PATCH 2/7] cputime: Remove extra cost in task_cputime |
| Message-ID | <qwzMT-2PJ-39@gated-at.bofh.it> |
| In reply to | #1273242 |
From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
There is an extra cost in task_cputime() and task_cputime_scaled() when
nohz_full is not activated. When vtime accounting is not enabled, we
don't need to get deltas of utime and stime under vtime seqlock.
This patch removes that cost with adding a shortcut route if vtime
accounting is not enabled.
Use context_tracking_is_enabled() to check if vtime is accounting on
some cpu, in which case only we need to check the tickless cputime delta.
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Cc: stable@vger.kernel.org
Cc: Christoph Lameter <cl@linux.com>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
kernel/sched/cputime.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index 05de80b..1128d4b 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -853,6 +853,14 @@ void task_cputime(struct task_struct *t, cputime_t *utime, cputime_t *stime)
{
cputime_t udelta, sdelta;
+ if (!context_tracking_is_enabled()) {
+ if (utime)
+ *utime = t->utime;
+ if (stime)
+ *stime = t->stime;
+ return;
+ }
+
fetch_task_cputime(t, utime, stime, &t->utime,
&t->stime, &udelta, &sdelta);
if (utime)
@@ -866,6 +874,14 @@ void task_cputime_scaled(struct task_struct *t,
{
cputime_t udelta, sdelta;
+ if (!context_tracking_is_enabled()) {
+ if (utimescaled)
+ *utimescaled = t->utimescaled;
+ if (stimescaled)
+ *stimescaled = t->stimescaled;
+ return;
+ }
+
fetch_task_cputime(t, utimescaled, stimescaled,
&t->utimescaled, &t->stimescaled, &udelta, &sdelta);
if (utimescaled)
--
2.5.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web