diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2016-11-14 21:06:51 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-11-15 03:51:05 -0500 |
commit | 40565b5aedd6d0ca88b7dfd3859d709d2f6f8cf9 (patch) | |
tree | 5fc1766834a640d3ae404c463ba99c3194eba8c7 /include/linux/sched.h | |
parent | 981ee2d444408fc55b9390d6a4a54a6697513611 (diff) |
sched/cputime, powerpc, s390: Make scaled cputime arch specific
Only s390 and powerpc have hardware facilities allowing to measure
cputimes scaled by frequency. On all other architectures
utimescaled/stimescaled are equal to utime/stime (however they are
accounted separately).
Remove {u,s}timescaled accounting on all architectures except
powerpc and s390, where those values are explicitly accounted
in the proper places.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Michael Neuling <mikey@neuling.org>
Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20161031162143.GB12646@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 3762fe4e3a80..f72e81395dac 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1647,7 +1647,10 @@ struct task_struct { | |||
1647 | int __user *set_child_tid; /* CLONE_CHILD_SETTID */ | 1647 | int __user *set_child_tid; /* CLONE_CHILD_SETTID */ |
1648 | int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */ | 1648 | int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */ |
1649 | 1649 | ||
1650 | cputime_t utime, stime, utimescaled, stimescaled; | 1650 | cputime_t utime, stime; |
1651 | #ifdef CONFIG_ARCH_HAS_SCALED_CPUTIME | ||
1652 | cputime_t utimescaled, stimescaled; | ||
1653 | #endif | ||
1651 | cputime_t gtime; | 1654 | cputime_t gtime; |
1652 | struct prev_cputime prev_cputime; | 1655 | struct prev_cputime prev_cputime; |
1653 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN | 1656 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN |
@@ -2240,8 +2243,6 @@ struct task_struct *try_get_task_struct(struct task_struct **ptask); | |||
2240 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN | 2243 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN |
2241 | extern void task_cputime(struct task_struct *t, | 2244 | extern void task_cputime(struct task_struct *t, |
2242 | cputime_t *utime, cputime_t *stime); | 2245 | cputime_t *utime, cputime_t *stime); |
2243 | extern void task_cputime_scaled(struct task_struct *t, | ||
2244 | cputime_t *utimescaled, cputime_t *stimescaled); | ||
2245 | extern cputime_t task_gtime(struct task_struct *t); | 2246 | extern cputime_t task_gtime(struct task_struct *t); |
2246 | #else | 2247 | #else |
2247 | static inline void task_cputime(struct task_struct *t, | 2248 | static inline void task_cputime(struct task_struct *t, |
@@ -2253,6 +2254,13 @@ static inline void task_cputime(struct task_struct *t, | |||
2253 | *stime = t->stime; | 2254 | *stime = t->stime; |
2254 | } | 2255 | } |
2255 | 2256 | ||
2257 | static inline cputime_t task_gtime(struct task_struct *t) | ||
2258 | { | ||
2259 | return t->gtime; | ||
2260 | } | ||
2261 | #endif | ||
2262 | |||
2263 | #ifdef CONFIG_ARCH_HAS_SCALED_CPUTIME | ||
2256 | static inline void task_cputime_scaled(struct task_struct *t, | 2264 | static inline void task_cputime_scaled(struct task_struct *t, |
2257 | cputime_t *utimescaled, | 2265 | cputime_t *utimescaled, |
2258 | cputime_t *stimescaled) | 2266 | cputime_t *stimescaled) |
@@ -2262,12 +2270,15 @@ static inline void task_cputime_scaled(struct task_struct *t, | |||
2262 | if (stimescaled) | 2270 | if (stimescaled) |
2263 | *stimescaled = t->stimescaled; | 2271 | *stimescaled = t->stimescaled; |
2264 | } | 2272 | } |
2265 | 2273 | #else | |
2266 | static inline cputime_t task_gtime(struct task_struct *t) | 2274 | static inline void task_cputime_scaled(struct task_struct *t, |
2275 | cputime_t *utimescaled, | ||
2276 | cputime_t *stimescaled) | ||
2267 | { | 2277 | { |
2268 | return t->gtime; | 2278 | task_cputime(t, utimescaled, stimescaled); |
2269 | } | 2279 | } |
2270 | #endif | 2280 | #endif |
2281 | |||
2271 | extern void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st); | 2282 | extern void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st); |
2272 | extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st); | 2283 | extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st); |
2273 | 2284 | ||