diff options
Diffstat (limited to 'fs/proc/loadavg.c')
-rw-r--r-- | fs/proc/loadavg.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/fs/proc/loadavg.c b/fs/proc/loadavg.c index 9bca39cf99ee..1afa4dd4cae2 100644 --- a/fs/proc/loadavg.c +++ b/fs/proc/loadavg.c | |||
@@ -12,20 +12,14 @@ | |||
12 | 12 | ||
13 | static int loadavg_proc_show(struct seq_file *m, void *v) | 13 | static int loadavg_proc_show(struct seq_file *m, void *v) |
14 | { | 14 | { |
15 | int a, b, c; | 15 | unsigned long avnrun[3]; |
16 | unsigned long seq; | ||
17 | 16 | ||
18 | do { | 17 | get_avenrun(avnrun, FIXED_1/200, 0); |
19 | seq = read_seqbegin(&xtime_lock); | ||
20 | a = avenrun[0] + (FIXED_1/200); | ||
21 | b = avenrun[1] + (FIXED_1/200); | ||
22 | c = avenrun[2] + (FIXED_1/200); | ||
23 | } while (read_seqretry(&xtime_lock, seq)); | ||
24 | 18 | ||
25 | seq_printf(m, "%d.%02d %d.%02d %d.%02d %ld/%d %d\n", | 19 | seq_printf(m, "%lu.%02lu %lu.%02lu %lu.%02lu %ld/%d %d\n", |
26 | LOAD_INT(a), LOAD_FRAC(a), | 20 | LOAD_INT(avnrun[0]), LOAD_FRAC(avnrun[0]), |
27 | LOAD_INT(b), LOAD_FRAC(b), | 21 | LOAD_INT(avnrun[1]), LOAD_FRAC(avnrun[1]), |
28 | LOAD_INT(c), LOAD_FRAC(c), | 22 | LOAD_INT(avnrun[2]), LOAD_FRAC(avnrun[2]), |
29 | nr_running(), nr_threads, | 23 | nr_running(), nr_threads, |
30 | task_active_pid_ns(current)->last_pid); | 24 | task_active_pid_ns(current)->last_pid); |
31 | return 0; | 25 | return 0; |