diff options
author | David Rientjes <rientjes@google.com> | 2015-11-05 21:50:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-05 22:34:48 -0500 |
commit | b72bdfa73603f2f81fbac651b9ae36807e877752 (patch) | |
tree | d302a8fb0e69169ef9e0749918ab6f0fd26ac2a9 /fs/proc | |
parent | c12176d3368b9b36ae484d323d41e94be26f9b65 (diff) |
mm, oom: add comment for why oom_adj exists
/proc/pid/oom_adj exists solely to avoid breaking existing userspace
binaries that write to the tunable.
Add a comment in the only possible location within the kernel tree to
describe the situation and motivation for keeping it around.
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/base.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 29595af32866..bd3e9e68125b 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1032,6 +1032,16 @@ static ssize_t oom_adj_read(struct file *file, char __user *buf, size_t count, | |||
1032 | return simple_read_from_buffer(buf, count, ppos, buffer, len); | 1032 | return simple_read_from_buffer(buf, count, ppos, buffer, len); |
1033 | } | 1033 | } |
1034 | 1034 | ||
1035 | /* | ||
1036 | * /proc/pid/oom_adj exists solely for backwards compatibility with previous | ||
1037 | * kernels. The effective policy is defined by oom_score_adj, which has a | ||
1038 | * different scale: oom_adj grew exponentially and oom_score_adj grows linearly. | ||
1039 | * Values written to oom_adj are simply mapped linearly to oom_score_adj. | ||
1040 | * Processes that become oom disabled via oom_adj will still be oom disabled | ||
1041 | * with this implementation. | ||
1042 | * | ||
1043 | * oom_adj cannot be removed since existing userspace binaries use it. | ||
1044 | */ | ||
1035 | static ssize_t oom_adj_write(struct file *file, const char __user *buf, | 1045 | static ssize_t oom_adj_write(struct file *file, const char __user *buf, |
1036 | size_t count, loff_t *ppos) | 1046 | size_t count, loff_t *ppos) |
1037 | { | 1047 | { |