Commit 9b8696f2 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] procfs LoadAVG/load_avg scaling fix

From: Ingo Molnar <mingo@elte.hu>

Dave reported that /proc/*/status sometimes shows 101% as LoadAVG, which
makes no sense.

the reason of the bug is slightly incorrect scaling of the load_avg value. 
The patch below fixes this.
parent 95f238ea
......@@ -162,7 +162,7 @@ static inline char * task_state(struct task_struct *p, char *buffer)
"Uid:\t%d\t%d\t%d\t%d\n"
"Gid:\t%d\t%d\t%d\t%d\n",
get_task_state(p),
(p->sleep_avg/1024)*100/(1000000000/1024),
(p->sleep_avg/1024)*100/(1020000000/1024),
p->tgid,
p->pid, p->pid ? p->real_parent->pid : 0,
p->pid && p->ptrace ? p->parent->pid : 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment