The patch titled oom: deprecate oom_adj tunable has been added to the -mm tree. Its filename is oom-deprecate-oom_adj-tunable.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/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: oom: deprecate oom_adj tunable From: David Rientjes <rientjes@xxxxxxxxxx> /proc/pid/oom_adj is now deprecated so that that it may eventually be removed. The target date for removal is August 2012. A warning will be printed to the kernel log if a task attempts to use this interface. Future warning will be suppressed until the kernel is rebooted to prevent spamming the kernel log. Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx> Cc: Nick Piggin <npiggin@xxxxxxx> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Cc: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: Balbir Singh <balbir@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- Documentation/feature-removal-schedule.txt | 25 +++++++++++++++++++ Documentation/filesystems/proc.txt | 3 ++ fs/proc/base.c | 8 ++++++ include/linux/oom.h | 3 ++ 4 files changed, 39 insertions(+) diff -puN Documentation/feature-removal-schedule.txt~oom-deprecate-oom_adj-tunable Documentation/feature-removal-schedule.txt --- a/Documentation/feature-removal-schedule.txt~oom-deprecate-oom_adj-tunable +++ a/Documentation/feature-removal-schedule.txt @@ -151,6 +151,31 @@ Who: Eric Biederman <ebiederm@xxxxxxxxxx --------------------------- +What: /proc/<pid>/oom_adj +When: August 2012 +Why: /proc/<pid>/oom_adj allows userspace to influence the oom killer's + badness heuristic used to determine which task to kill when the kernel + is out of memory. + + The badness heuristic has since been rewritten since the introduction of + this tunable such that its meaning is deprecated. The value was + implemented as a bitshift on a score generated by the badness() + function that did not have any precise units of measure. With the + rewrite, the score is given as a proportion of available memory to the + task allocating pages, so using a bitshift which grows the score + exponentially is, thus, impossible to tune with fine granularity. + + A much more powerful interface, /proc/<pid>/oom_score_adj, was + introduced with the oom killer rewrite that allows users to increase or + decrease the badness() score linearly. This interface will replace + /proc/<pid>/oom_adj. + + A warning will be emitted to the kernel log if an application uses this + deprecated interface. After it is printed once, future warnings will be + suppressed until the kernel is rebooted. + +--------------------------- + What: remove EXPORT_SYMBOL(kernel_thread) When: August 2006 Files: arch/*/kernel/*_ksyms.c diff -puN Documentation/filesystems/proc.txt~oom-deprecate-oom_adj-tunable Documentation/filesystems/proc.txt --- a/Documentation/filesystems/proc.txt~oom-deprecate-oom_adj-tunable +++ a/Documentation/filesystems/proc.txt @@ -1285,6 +1285,9 @@ scaled linearly with /proc/<pid>/oom_sco Writing to /proc/<pid>/oom_score_adj or /proc/<pid>/oom_adj will change the other with its scaled value. +NOTICE: /proc/<pid>/oom_adj is deprecated and will be removed, please see +Documentation/feature-removal-schedule.txt. + Caveat: when a parent task is selected, the oom killer will sacrifice any first generation children with seperate address spaces instead, if possible. This avoids servers and important system daemons from being killed and loses the diff -puN fs/proc/base.c~oom-deprecate-oom_adj-tunable fs/proc/base.c --- a/fs/proc/base.c~oom-deprecate-oom_adj-tunable +++ a/fs/proc/base.c @@ -1049,6 +1049,14 @@ static ssize_t oom_adjust_write(struct f return -EACCES; } + /* + * Warn that /proc/pid/oom_adj is deprecated, see + * Documentation/feature-removal-schedule.txt. + */ + printk_once(KERN_WARNING "%s (%d): /proc/%d/oom_adj is deprecated, " + "please use /proc/%d/oom_score_adj instead.\n", + current->comm, task_pid_nr(current), + task_pid_nr(task), task_pid_nr(task)); task->signal->oom_adj = oom_adjust; /* * Scale /proc/pid/oom_score_adj appropriately ensuring that a maximum diff -puN include/linux/oom.h~oom-deprecate-oom_adj-tunable include/linux/oom.h --- a/include/linux/oom.h~oom-deprecate-oom_adj-tunable +++ a/include/linux/oom.h @@ -2,6 +2,9 @@ #define __INCLUDE_LINUX_OOM_H /* + * /proc/<pid>/oom_adj is deprecated, see + * Documentation/feature-removal-schedule.txt. + * * /proc/<pid>/oom_adj set to -17 protects from the oom-killer */ #define OOM_DISABLE (-17) _ Patches currently in -mm which might be from rientjes@xxxxxxxxxx are linux-next.patch infiniband-remove-dependency-on-__gfp_nofail.patch fs-bio-integrityc-remove-dependency-on-__gfp_nofail.patch fs-bio-integrityc-return-enomem-on-kmalloc-failure.patch oom-check-pf_kthread-instead-of-mm-to-skip-kthreads.patch oom-pf_exiting-check-should-take-mm-into-account.patch oom-introduce-find_lock_task_mm-to-fix-mm-false-positives.patch oom-dump_tasks-use-find_lock_task_mm-too.patch oom-improve-commentary-in-dump_tasks.patch oom-dump_tasks-use-find_lock_task_mm-too-dump_tasks-use-find_lock_task_mm-too-fix.patch oom-give-current-access-to-memory-reserves-if-it-has-been-killed.patch oom-avoid-sending-exiting-tasks-a-sigkill.patch oom-filter-tasks-not-sharing-the-same-cpuset.patch oom-sacrifice-child-with-highest-badness-score-for-parent.patch oom-sacrifice-child-with-highest-badness-score-for-parent-protect-dereferencing-of-tasks-comm.patch oom-sacrifice-child-with-highest-badness-score-for-parent-fix.patch oom-select-task-from-tasklist-for-mempolicy-ooms.patch oom-select-task-from-tasklist-for-mempolicy-ooms-add-has_intersects_mems_allowed-uma-variant.patch oom-select-task-from-tasklist-for-mempolicy-ooms-introduce-find_lock_task_mm-to-fix-mm-false-positives-fix.patch oom-enable-oom-tasklist-dump-by-default.patch oom-avoid-oom-killer-for-lowmem-allocations.patch oom-extract-panic-helper-function.patch oom-remove-special-handling-for-pagefault-ooms.patch oom-move-sysctl-declarations-to-oomh.patch oom-remove-unnecessary-code-and-cleanup.patch mm-rename-try_set_zone_oom-to-try_set_zonelist_oom.patch oom-remove-constraint-argument-from-select_bad_process-and-__out_of_memory.patch oom-fold-__out_of_memory-into-out_of_memory.patch avr32-invoke-oom-killer-from-page-fault.patch oom-dont-try-to-kill-oom_unkillable-child.patch oom-oom_kill_process-doesnt-select-kthread-child.patch oom-make-oom_unkillable_task-helper-function.patch oom-oom_kill_process-needs-to-check-that-p-is-unkillable.patch oom-proc-pid-oom_score-treat-kernel-thread-honestly.patch oom-kill-duplicate-oom_disable-check.patch oom-move-oom_disable-check-from-oom_kill_task-to-out_of_memory.patch oom-cleanup-has_intersects_mems_allowed.patch oom-remove-child-mm-check-from-oom_kill_process.patch oom-give-the-dying-task-a-higher-priority.patch oom-multi-threaded-process-coredump-dont-make-deadlock.patch oom-move-badness-declaration-into-oomh.patch oom-move-badness-declaration-into-oomh-fix.patch oom-badness-heuristic-rewrite.patch oom-deprecate-oom_adj-tunable.patch jbd-remove-dependency-on-__gfp_nofail.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