diff options
Diffstat (limited to 'mm/oom_kill.c')
| -rw-r--r-- | mm/oom_kill.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 40ba05061a4f..2f3166e308d9 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
| @@ -55,7 +55,7 @@ static DEFINE_SPINLOCK(zone_scan_lock); | |||
| 55 | 55 | ||
| 56 | unsigned long badness(struct task_struct *p, unsigned long uptime) | 56 | unsigned long badness(struct task_struct *p, unsigned long uptime) |
| 57 | { | 57 | { |
| 58 | unsigned long points, cpu_time, run_time, s; | 58 | unsigned long points, cpu_time, run_time; |
| 59 | struct mm_struct *mm; | 59 | struct mm_struct *mm; |
| 60 | struct task_struct *child; | 60 | struct task_struct *child; |
| 61 | 61 | ||
| @@ -110,12 +110,10 @@ unsigned long badness(struct task_struct *p, unsigned long uptime) | |||
| 110 | else | 110 | else |
| 111 | run_time = 0; | 111 | run_time = 0; |
| 112 | 112 | ||
| 113 | s = int_sqrt(cpu_time); | 113 | if (cpu_time) |
| 114 | if (s) | 114 | points /= int_sqrt(cpu_time); |
| 115 | points /= s; | 115 | if (run_time) |
| 116 | s = int_sqrt(int_sqrt(run_time)); | 116 | points /= int_sqrt(int_sqrt(run_time)); |
| 117 | if (s) | ||
| 118 | points /= s; | ||
| 119 | 117 | ||
| 120 | /* | 118 | /* |
| 121 | * Niced processes are most likely less important, so double | 119 | * Niced processes are most likely less important, so double |
| @@ -396,6 +394,7 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, | |||
| 396 | cpuset_print_task_mems_allowed(current); | 394 | cpuset_print_task_mems_allowed(current); |
| 397 | task_unlock(current); | 395 | task_unlock(current); |
| 398 | dump_stack(); | 396 | dump_stack(); |
| 397 | mem_cgroup_print_oom_info(mem, current); | ||
| 399 | show_mem(); | 398 | show_mem(); |
| 400 | if (sysctl_oom_dump_tasks) | 399 | if (sysctl_oom_dump_tasks) |
| 401 | dump_tasks(mem); | 400 | dump_tasks(mem); |
