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 /fs/proc/uptime.c | |
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 'fs/proc/uptime.c')
-rw-r--r-- | fs/proc/uptime.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/proc/uptime.c b/fs/proc/uptime.c index 33de567c25af..7981c4ffe787 100644 --- a/fs/proc/uptime.c +++ b/fs/proc/uptime.c | |||
@@ -5,23 +5,20 @@ | |||
5 | #include <linux/seq_file.h> | 5 | #include <linux/seq_file.h> |
6 | #include <linux/time.h> | 6 | #include <linux/time.h> |
7 | #include <linux/kernel_stat.h> | 7 | #include <linux/kernel_stat.h> |
8 | #include <linux/cputime.h> | ||
9 | 8 | ||
10 | static int uptime_proc_show(struct seq_file *m, void *v) | 9 | static int uptime_proc_show(struct seq_file *m, void *v) |
11 | { | 10 | { |
12 | struct timespec uptime; | 11 | struct timespec uptime; |
13 | struct timespec idle; | 12 | struct timespec idle; |
14 | u64 idletime; | ||
15 | u64 nsec; | 13 | u64 nsec; |
16 | u32 rem; | 14 | u32 rem; |
17 | int i; | 15 | int i; |
18 | 16 | ||
19 | idletime = 0; | 17 | nsec = 0; |
20 | for_each_possible_cpu(i) | 18 | for_each_possible_cpu(i) |
21 | idletime += (__force u64) kcpustat_cpu(i).cpustat[CPUTIME_IDLE]; | 19 | nsec += (__force u64) kcpustat_cpu(i).cpustat[CPUTIME_IDLE]; |
22 | 20 | ||
23 | get_monotonic_boottime(&uptime); | 21 | get_monotonic_boottime(&uptime); |
24 | nsec = cputime64_to_jiffies64(idletime) * TICK_NSEC; | ||
25 | idle.tv_sec = div_u64_rem(nsec, NSEC_PER_SEC, &rem); | 22 | idle.tv_sec = div_u64_rem(nsec, NSEC_PER_SEC, &rem); |
26 | idle.tv_nsec = rem; | 23 | idle.tv_nsec = rem; |
27 | seq_printf(m, "%lu.%02lu %lu.%02lu\n", | 24 | seq_printf(m, "%lu.%02lu %lu.%02lu\n", |