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 d2d3108a611c..d7d711876b6a 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -411,12 +411,13 @@ static const struct file_operations proc_lstats_operations = { | |||
411 | 411 | ||
412 | static int proc_oom_score(struct task_struct *task, char *buffer) | 412 | static int proc_oom_score(struct task_struct *task, char *buffer) |
413 | { | 413 | { |
414 | unsigned long totalpages = totalram_pages + total_swap_pages; | ||
414 | unsigned long points = 0; | 415 | unsigned long points = 0; |
415 | 416 | ||
416 | read_lock(&tasklist_lock); | 417 | read_lock(&tasklist_lock); |
417 | if (pid_alive(task)) | 418 | if (pid_alive(task)) |
418 | points = oom_badness(task, NULL, NULL, | 419 | points = oom_badness(task, NULL, NULL, totalpages) * |
419 | totalram_pages + total_swap_pages); | 420 | 1000 / totalpages; |
420 | read_unlock(&tasklist_lock); | 421 | read_unlock(&tasklist_lock); |
421 | return sprintf(buffer, "%lu\n", points); | 422 | return sprintf(buffer, "%lu\n", points); |
422 | } | 423 | } |