diff options
-rw-r--r-- | fs/proc/proc_misc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 383ff068ab2e..2686592dbcb2 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
@@ -84,10 +84,15 @@ static int loadavg_read_proc(char *page, char **start, off_t off, | |||
84 | { | 84 | { |
85 | int a, b, c; | 85 | int a, b, c; |
86 | int len; | 86 | int len; |
87 | unsigned long seq; | ||
88 | |||
89 | do { | ||
90 | seq = read_seqbegin(&xtime_lock); | ||
91 | a = avenrun[0] + (FIXED_1/200); | ||
92 | b = avenrun[1] + (FIXED_1/200); | ||
93 | c = avenrun[2] + (FIXED_1/200); | ||
94 | } while (read_seqretry(&xtime_lock, seq)); | ||
87 | 95 | ||
88 | a = avenrun[0] + (FIXED_1/200); | ||
89 | b = avenrun[1] + (FIXED_1/200); | ||
90 | c = avenrun[2] + (FIXED_1/200); | ||
91 | len = sprintf(page,"%d.%02d %d.%02d %d.%02d %ld/%d %d\n", | 96 | len = sprintf(page,"%d.%02d %d.%02d %d.%02d %ld/%d %d\n", |
92 | LOAD_INT(a), LOAD_FRAC(a), | 97 | LOAD_INT(a), LOAD_FRAC(a), |
93 | LOAD_INT(b), LOAD_FRAC(b), | 98 | LOAD_INT(b), LOAD_FRAC(b), |