* Re: [patch] mm, oom: add comment for why oom_adj exists
@ 2015-11-06 3:52 Hillf Danton
0 siblings, 0 replies; only message in thread
From: Hillf Danton @ 2015-11-06 3:52 UTC (permalink / raw)
To: David Rientjes
Cc: Andrew Morton, Michal Hocko, linux-kernel, linux-mm,
Hongjie.Fang, 'Eric W. Biederman'
>
> /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>
> ---
Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com>
> fs/proc/base.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> --- 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,
> return simple_read_from_buffer(buf, count, ppos, buffer, len);
> }
>
> +/*
> + * /proc/pid/oom_adj exists solely for backwards compatibility with previous
> + * kernels. The effective policy is defined by oom_score_adj, which has a
> + * different scale: oom_adj grew exponentially and oom_score_adj grows linearly.
> + * Values written to oom_adj are simply mapped linearly to oom_score_adj.
> + * Processes that become oom disabled via oom_adj will still be oom disabled
> + * with this implementation.
> + *
> + * oom_adj cannot be removed since existing userspace binaries use it.
> + */
> static ssize_t oom_adj_write(struct file *file, const char __user *buf,
> size_t count, loff_t *ppos)
> {
> --
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-11-06 3:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-06 3:52 [patch] mm, oom: add comment for why oom_adj exists Hillf Danton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox