oom_kill.c (94851b18d4eb94f8bbf0d9176f7429bd8e371f62) | oom_kill.c (e1f56c89b040134add93f686931cc266541d239a) |
---|---|
1/* 2 * linux/mm/oom_kill.c 3 * 4 * Copyright (C) 1998,2000 Rik van Riel 5 * Thanks go out to Claus Fischer for some serious inspiration and 6 * for goading me into coding this file... 7 * Copyright (C) 2010 Google, Inc. 8 * Rewritten by David Rientjes --- 147 unchanged lines hidden (view full) --- 156 task_unlock(p); 157 return 0; 158 } 159 160 /* 161 * The baseline for the badness score is the proportion of RAM that each 162 * task's rss, pagetable and swap space use. 163 */ | 1/* 2 * linux/mm/oom_kill.c 3 * 4 * Copyright (C) 1998,2000 Rik van Riel 5 * Thanks go out to Claus Fischer for some serious inspiration and 6 * for goading me into coding this file... 7 * Copyright (C) 2010 Google, Inc. 8 * Rewritten by David Rientjes --- 147 unchanged lines hidden (view full) --- 156 task_unlock(p); 157 return 0; 158 } 159 160 /* 161 * The baseline for the badness score is the proportion of RAM that each 162 * task's rss, pagetable and swap space use. 163 */ |
164 points = get_mm_rss(p->mm) + p->mm->nr_ptes + | 164 points = get_mm_rss(p->mm) + atomic_long_read(&p->mm->nr_ptes) + |
165 get_mm_counter(p->mm, MM_SWAPENTS); 166 task_unlock(p); 167 168 /* 169 * Root processes get 3% bonus, just like the __vm_enough_memory() 170 * implementation used by LSMs. 171 */ 172 if (has_capability_noaudit(p, CAP_SYS_ADMIN)) --- 186 unchanged lines hidden (view full) --- 359 /* 360 * This is a kthread or all of p's threads have already 361 * detached their mm's. There's no need to report 362 * them; they can't be oom killed anyway. 363 */ 364 continue; 365 } 366 | 165 get_mm_counter(p->mm, MM_SWAPENTS); 166 task_unlock(p); 167 168 /* 169 * Root processes get 3% bonus, just like the __vm_enough_memory() 170 * implementation used by LSMs. 171 */ 172 if (has_capability_noaudit(p, CAP_SYS_ADMIN)) --- 186 unchanged lines hidden (view full) --- 359 /* 360 * This is a kthread or all of p's threads have already 361 * detached their mm's. There's no need to report 362 * them; they can't be oom killed anyway. 363 */ 364 continue; 365 } 366 |
367 pr_info("[%5d] %5d %5d %8lu %8lu %7lu %8lu %5hd %s\n", | 367 pr_info("[%5d] %5d %5d %8lu %8lu %7ld %8lu %5hd %s\n", |
368 task->pid, from_kuid(&init_user_ns, task_uid(task)), 369 task->tgid, task->mm->total_vm, get_mm_rss(task->mm), | 368 task->pid, from_kuid(&init_user_ns, task_uid(task)), 369 task->tgid, task->mm->total_vm, get_mm_rss(task->mm), |
370 task->mm->nr_ptes, | 370 atomic_long_read(&task->mm->nr_ptes), |
371 get_mm_counter(task->mm, MM_SWAPENTS), 372 task->signal->oom_score_adj, task->comm); 373 task_unlock(task); 374 } 375 rcu_read_unlock(); 376} 377 378static void dump_header(struct task_struct *p, gfp_t gfp_mask, int order, --- 313 unchanged lines hidden --- | 371 get_mm_counter(task->mm, MM_SWAPENTS), 372 task->signal->oom_score_adj, task->comm); 373 task_unlock(task); 374 } 375 rcu_read_unlock(); 376} 377 378static void dump_header(struct task_struct *p, gfp_t gfp_mask, int order, --- 313 unchanged lines hidden --- |