diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-20 15:52:55 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-20 15:52:55 -0500 |
| commit | 828cad8ea05d194d8a9452e0793261c2024c23a2 (patch) | |
| tree | 0ad7c7e044cdcfe75d78da0b52eb2358d4686e02 /include/asm-generic | |
| parent | 60c906bab124a0627fba04c9ca5e61bba4747c0c (diff) | |
| parent | bb3bac2ca9a3a5b7fa601781adf70167a0449d75 (diff) | |
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler updates from Ingo Molnar:
"The main changes in this (fairly busy) cycle were:
- There was a class of scheduler bugs related to forgetting to update
the rq-clock timestamp which can cause weird and hard to debug
problems, so there's a new debug facility for this: which uncovered
a whole lot of bugs which convinced us that we want to keep the
debug facility.
(Peter Zijlstra, Matt Fleming)
- Various cputime related updates: eliminate cputime and use u64
nanoseconds directly, simplify and improve the arch interfaces,
implement delayed accounting more widely, etc. - (Frederic
Weisbecker)
- Move code around for better structure plus cleanups (Ingo Molnar)
- Move IO schedule accounting deeper into the scheduler plus related
changes to improve the situation (Tejun Heo)
- ... plus a round of sched/rt and sched/deadline fixes, plus other
fixes, updats and cleanups"
* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (85 commits)
sched/core: Remove unlikely() annotation from sched_move_task()
sched/autogroup: Rename auto_group.[ch] to autogroup.[ch]
sched/topology: Split out scheduler topology code from core.c into topology.c
sched/core: Remove unnecessary #include headers
sched/rq_clock: Consolidate the ordering of the rq_clock methods
delayacct: Include <uapi/linux/taskstats.h>
sched/core: Clean up comments
sched/rt: Show the 'sched_rr_timeslice' SCHED_RR timeslice tuning knob in milliseconds
sched/clock: Add dummy clear_sched_clock_stable() stub function
sched/cputime: Remove generic asm headers
sched/cputime: Remove unused nsec_to_cputime()
s390, sched/cputime: Remove unused cputime definitions
powerpc, sched/cputime: Remove unused cputime definitions
s390, sched/cputime: Make arch_cpu_idle_time() to return nsecs
ia64, sched/cputime: Remove unused cputime definitions
ia64: Convert vtime to use nsec units directly
ia64, sched/cputime: Move the nsecs based cputime headers to the last arch using it
sched/cputime: Remove jiffies based cputime
sched/cputime, vtime: Return nsecs instead of cputime_t to account
sched/cputime: Complete nsec conversion of tick based accounting
...
Diffstat (limited to 'include/asm-generic')
| -rw-r--r-- | include/asm-generic/cputime.h | 15 | ||||
| -rw-r--r-- | include/asm-generic/cputime_jiffies.h | 75 | ||||
| -rw-r--r-- | include/asm-generic/cputime_nsecs.h | 121 |
3 files changed, 0 insertions, 211 deletions
diff --git a/include/asm-generic/cputime.h b/include/asm-generic/cputime.h deleted file mode 100644 index 51969436b8b8..000000000000 --- a/include/asm-generic/cputime.h +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | #ifndef _ASM_GENERIC_CPUTIME_H | ||
| 2 | #define _ASM_GENERIC_CPUTIME_H | ||
| 3 | |||
| 4 | #include <linux/time.h> | ||
| 5 | #include <linux/jiffies.h> | ||
| 6 | |||
| 7 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | ||
| 8 | # include <asm-generic/cputime_jiffies.h> | ||
| 9 | #endif | ||
| 10 | |||
| 11 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN | ||
| 12 | # include <asm-generic/cputime_nsecs.h> | ||
| 13 | #endif | ||
| 14 | |||
| 15 | #endif | ||
diff --git a/include/asm-generic/cputime_jiffies.h b/include/asm-generic/cputime_jiffies.h deleted file mode 100644 index 6bb8cd45f53b..000000000000 --- a/include/asm-generic/cputime_jiffies.h +++ /dev/null | |||
| @@ -1,75 +0,0 @@ | |||
| 1 | #ifndef _ASM_GENERIC_CPUTIME_JIFFIES_H | ||
| 2 | #define _ASM_GENERIC_CPUTIME_JIFFIES_H | ||
| 3 | |||
| 4 | typedef unsigned long __nocast cputime_t; | ||
| 5 | |||
| 6 | #define cmpxchg_cputime(ptr, old, new) cmpxchg(ptr, old, new) | ||
| 7 | |||
| 8 | #define cputime_one_jiffy jiffies_to_cputime(1) | ||
| 9 | #define cputime_to_jiffies(__ct) (__force unsigned long)(__ct) | ||
| 10 | #define jiffies_to_cputime(__hz) (__force cputime_t)(__hz) | ||
| 11 | |||
| 12 | typedef u64 __nocast cputime64_t; | ||
| 13 | |||
| 14 | #define cputime64_to_jiffies64(__ct) (__force u64)(__ct) | ||
| 15 | #define jiffies64_to_cputime64(__jif) (__force cputime64_t)(__jif) | ||
| 16 | |||
| 17 | |||
| 18 | /* | ||
| 19 | * Convert nanoseconds <-> cputime | ||
| 20 | */ | ||
| 21 | #define cputime_to_nsecs(__ct) \ | ||
| 22 | jiffies_to_nsecs(cputime_to_jiffies(__ct)) | ||
| 23 | #define nsecs_to_cputime64(__nsec) \ | ||
| 24 | jiffies64_to_cputime64(nsecs_to_jiffies64(__nsec)) | ||
| 25 | #define nsecs_to_cputime(__nsec) \ | ||
| 26 | jiffies_to_cputime(nsecs_to_jiffies(__nsec)) | ||
| 27 | |||
| 28 | |||
| 29 | /* | ||
| 30 | * Convert cputime to microseconds and back. | ||
| 31 | */ | ||
| 32 | #define cputime_to_usecs(__ct) \ | ||
| 33 | jiffies_to_usecs(cputime_to_jiffies(__ct)) | ||
| 34 | #define usecs_to_cputime(__usec) \ | ||
| 35 | jiffies_to_cputime(usecs_to_jiffies(__usec)) | ||
| 36 | #define usecs_to_cputime64(__usec) \ | ||
| 37 | jiffies64_to_cputime64(nsecs_to_jiffies64((__usec) * 1000)) | ||
| 38 | |||
| 39 | /* | ||
| 40 | * Convert cputime to seconds and back. | ||
| 41 | */ | ||
| 42 | #define cputime_to_secs(jif) (cputime_to_jiffies(jif) / HZ) | ||
| 43 | #define secs_to_cputime(sec) jiffies_to_cputime((sec) * HZ) | ||
| 44 | |||
| 45 | /* | ||
| 46 | * Convert cputime to timespec and back. | ||
| 47 | */ | ||
| 48 | #define timespec_to_cputime(__val) \ | ||
| 49 | jiffies_to_cputime(timespec_to_jiffies(__val)) | ||
| 50 | #define cputime_to_timespec(__ct,__val) \ | ||
| 51 | jiffies_to_timespec(cputime_to_jiffies(__ct),__val) | ||
| 52 | |||
| 53 | /* | ||
| 54 | * Convert cputime to timeval and back. | ||
| 55 | */ | ||
| 56 | #define timeval_to_cputime(__val) \ | ||
| 57 | jiffies_to_cputime(timeval_to_jiffies(__val)) | ||
| 58 | #define cputime_to_timeval(__ct,__val) \ | ||
| 59 | jiffies_to_timeval(cputime_to_jiffies(__ct),__val) | ||
| 60 | |||
| 61 | /* | ||
| 62 | * Convert cputime to clock and back. | ||
| 63 | */ | ||
| 64 | #define cputime_to_clock_t(__ct) \ | ||
| 65 | jiffies_to_clock_t(cputime_to_jiffies(__ct)) | ||
| 66 | #define clock_t_to_cputime(__x) \ | ||
| 67 | jiffies_to_cputime(clock_t_to_jiffies(__x)) | ||
| 68 | |||
| 69 | /* | ||
| 70 | * Convert cputime64 to clock. | ||
| 71 | */ | ||
| 72 | #define cputime64_to_clock_t(__ct) \ | ||
| 73 | jiffies_64_to_clock_t(cputime64_to_jiffies64(__ct)) | ||
| 74 | |||
| 75 | #endif | ||
diff --git a/include/asm-generic/cputime_nsecs.h b/include/asm-generic/cputime_nsecs.h deleted file mode 100644 index 4e3b18e559b1..000000000000 --- a/include/asm-generic/cputime_nsecs.h +++ /dev/null | |||
| @@ -1,121 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Definitions for measuring cputime in nsecs resolution. | ||
| 3 | * | ||
| 4 | * Based on <arch/ia64/include/asm/cputime.h> | ||
| 5 | * | ||
| 6 | * Copyright (C) 2007 FUJITSU LIMITED | ||
| 7 | * Copyright (C) 2007 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or | ||
| 10 | * modify it under the terms of the GNU General Public License | ||
| 11 | * as published by the Free Software Foundation; either version | ||
| 12 | * 2 of the License, or (at your option) any later version. | ||
| 13 | * | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef _ASM_GENERIC_CPUTIME_NSECS_H | ||
| 17 | #define _ASM_GENERIC_CPUTIME_NSECS_H | ||
| 18 | |||
| 19 | #include <linux/math64.h> | ||
| 20 | |||
| 21 | typedef u64 __nocast cputime_t; | ||
| 22 | typedef u64 __nocast cputime64_t; | ||
| 23 | |||
| 24 | #define cmpxchg_cputime(ptr, old, new) cmpxchg64(ptr, old, new) | ||
| 25 | |||
| 26 | #define cputime_one_jiffy jiffies_to_cputime(1) | ||
| 27 | |||
| 28 | #define cputime_div(__ct, divisor) div_u64((__force u64)__ct, divisor) | ||
| 29 | #define cputime_div_rem(__ct, divisor, remainder) \ | ||
| 30 | div_u64_rem((__force u64)__ct, divisor, remainder); | ||
| 31 | |||
| 32 | /* | ||
| 33 | * Convert cputime <-> jiffies (HZ) | ||
| 34 | */ | ||
| 35 | #define cputime_to_jiffies(__ct) \ | ||
| 36 | cputime_div(__ct, NSEC_PER_SEC / HZ) | ||
| 37 | #define jiffies_to_cputime(__jif) \ | ||
| 38 | (__force cputime_t)((__jif) * (NSEC_PER_SEC / HZ)) | ||
| 39 | #define cputime64_to_jiffies64(__ct) \ | ||
| 40 | cputime_div(__ct, NSEC_PER_SEC / HZ) | ||
| 41 | #define jiffies64_to_cputime64(__jif) \ | ||
| 42 | (__force cputime64_t)((__jif) * (NSEC_PER_SEC / HZ)) | ||
| 43 | |||
| 44 | |||
| 45 | /* | ||
| 46 | * Convert cputime <-> nanoseconds | ||
| 47 | */ | ||
| 48 | #define cputime_to_nsecs(__ct) \ | ||
| 49 | (__force u64)(__ct) | ||
| 50 | #define nsecs_to_cputime(__nsecs) \ | ||
| 51 | (__force cputime_t)(__nsecs) | ||
| 52 | #define nsecs_to_cputime64(__nsecs) \ | ||
| 53 | (__force cputime64_t)(__nsecs) | ||
| 54 | |||
| 55 | |||
| 56 | /* | ||
| 57 | * Convert cputime <-> microseconds | ||
| 58 | */ | ||
| 59 | #define cputime_to_usecs(__ct) \ | ||
| 60 | cputime_div(__ct, NSEC_PER_USEC) | ||
| 61 | #define usecs_to_cputime(__usecs) \ | ||
| 62 | (__force cputime_t)((__usecs) * NSEC_PER_USEC) | ||
| 63 | #define usecs_to_cputime64(__usecs) \ | ||
| 64 | (__force cputime64_t)((__usecs) * NSEC_PER_USEC) | ||
| 65 | |||
| 66 | /* | ||
| 67 | * Convert cputime <-> seconds | ||
| 68 | */ | ||
| 69 | #define cputime_to_secs(__ct) \ | ||
| 70 | cputime_div(__ct, NSEC_PER_SEC) | ||
| 71 | #define secs_to_cputime(__secs) \ | ||
| 72 | (__force cputime_t)((__secs) * NSEC_PER_SEC) | ||
| 73 | |||
| 74 | /* | ||
| 75 | * Convert cputime <-> timespec (nsec) | ||
| 76 | */ | ||
| 77 | static inline cputime_t timespec_to_cputime(const struct timespec *val) | ||
| 78 | { | ||
| 79 | u64 ret = (u64)val->tv_sec * NSEC_PER_SEC + val->tv_nsec; | ||
| 80 | return (__force cputime_t) ret; | ||
| 81 | } | ||
| 82 | static inline void cputime_to_timespec(const cputime_t ct, struct timespec *val) | ||
| 83 | { | ||
| 84 | u32 rem; | ||
| 85 | |||
| 86 | val->tv_sec = cputime_div_rem(ct, NSEC_PER_SEC, &rem); | ||
| 87 | val->tv_nsec = rem; | ||
| 88 | } | ||
| 89 | |||
| 90 | /* | ||
| 91 | * Convert cputime <-> timeval (msec) | ||
| 92 | */ | ||
| 93 | static inline cputime_t timeval_to_cputime(const struct timeval *val) | ||
| 94 | { | ||
| 95 | u64 ret = (u64)val->tv_sec * NSEC_PER_SEC + | ||
| 96 | val->tv_usec * NSEC_PER_USEC; | ||
| 97 | return (__force cputime_t) ret; | ||
| 98 | } | ||
| 99 | static inline void cputime_to_timeval(const cputime_t ct, struct timeval *val) | ||
| 100 | { | ||
| 101 | u32 rem; | ||
| 102 | |||
| 103 | val->tv_sec = cputime_div_rem(ct, NSEC_PER_SEC, &rem); | ||
| 104 | val->tv_usec = rem / NSEC_PER_USEC; | ||
| 105 | } | ||
| 106 | |||
| 107 | /* | ||
| 108 | * Convert cputime <-> clock (USER_HZ) | ||
| 109 | */ | ||
| 110 | #define cputime_to_clock_t(__ct) \ | ||
| 111 | cputime_div(__ct, (NSEC_PER_SEC / USER_HZ)) | ||
| 112 | #define clock_t_to_cputime(__x) \ | ||
| 113 | (__force cputime_t)((__x) * (NSEC_PER_SEC / USER_HZ)) | ||
| 114 | |||
| 115 | /* | ||
| 116 | * Convert cputime64 to clock. | ||
| 117 | */ | ||
| 118 | #define cputime64_to_clock_t(__ct) \ | ||
| 119 | cputime_to_clock_t((__force cputime_t)__ct) | ||
| 120 | |||
| 121 | #endif | ||
