diff options
Diffstat (limited to 'fs/proc/base.c')
| -rw-r--r-- | fs/proc/base.c | 5 | 
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index d2d3108a611..d7d711876b6 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -411,12 +411,13 @@ static const struct file_operations proc_lstats_operations = {  static int proc_oom_score(struct task_struct *task, char *buffer)  { +	unsigned long totalpages = totalram_pages + total_swap_pages;  	unsigned long points = 0;  	read_lock(&tasklist_lock);  	if (pid_alive(task)) -		points = oom_badness(task, NULL, NULL, -					totalram_pages + total_swap_pages); +		points = oom_badness(task, NULL, NULL, totalpages) * +						1000 / totalpages;  	read_unlock(&tasklist_lock);  	return sprintf(buffer, "%lu\n", points);  }  |