The patch titled Subject: mm, oom: remove 3% bonus for CAP_SYS_ADMIN processes has been added to the -mm tree. Its filename is mm-oom-remove-3%-bonus-for-cap_sys_admin-processes.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-oom-remove-3%25-bonus-for-cap_sys_admin-processes.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-oom-remove-3%25-bonus-for-cap_sys_admin-processes.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: David Rientjes <rientjes@xxxxxxxxxx> Subject: mm, oom: remove 3% bonus for CAP_SYS_ADMIN processes Since the 2.6 kernel, the oom killer has slightly biased away from CAP_SYS_ADMIN processes by discounting some of its memory usage in comparison to other processes. This has always been implicit and nothing exactly relies on the behavior. Gaurav notices that __task_cred() can dereference a potentially freed pointer if the task under consideration is exiting because a reference to the task_struct is not held. Remove the CAP_SYS_ADMIN bias so that all processes are treated equally. If any CAP_SYS_ADMIN process would like to be biased against, it is always allowed to adjust /proc/pid/oom_score_adj. Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1803071548510.6996@xxxxxxxxxxxxxxxxxxxxxxxxx Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx> Reported-by: Gaurav Kohli <gkohli@xxxxxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/oom_kill.c | 7 ------- 1 file changed, 7 deletions(-) diff -puN mm/oom_kill.c~mm-oom-remove-3%-bonus-for-cap_sys_admin-processes mm/oom_kill.c --- a/mm/oom_kill.c~mm-oom-remove-3%-bonus-for-cap_sys_admin-processes +++ a/mm/oom_kill.c @@ -226,13 +226,6 @@ unsigned long oom_badness(struct task_st mm_pgtables_bytes(p->mm) / PAGE_SIZE; task_unlock(p); - /* - * Root processes get 3% bonus, just like the __vm_enough_memory() - * implementation used by LSMs. - */ - if (has_capability_noaudit(p, CAP_SYS_ADMIN)) - points -= (points * 3) / 100; - /* Normalize to oom_score_adj units */ adj *= totalpages / 1000; points += adj; _ Patches currently in -mm which might be from rientjes@xxxxxxxxxx are mm-page_alloc-extend-kernelcore-and-movablecore-for-percent.patch mm-page_alloc-extend-kernelcore-and-movablecore-for-percent-fix.patch mm-page_alloc-move-mirrored_kernelcore-to-__meminitdata.patch mm-compaction-drain-pcps-for-zone-when-kcompactd-fails.patch mm-oom-remove-3%-bonus-for-cap_sys_admin-processes.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html