Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031987AbbKEK2p (ORCPT ); Thu, 5 Nov 2015 05:28:45 -0500 Received: from mail-wi0-f171.google.com ([209.85.212.171]:32840 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031093AbbKEK2o (ORCPT ); Thu, 5 Nov 2015 05:28:44 -0500 Date: Thu, 5 Nov 2015 11:28:41 +0100 From: Michal Hocko To: David Rientjes Cc: Andrew Morton , Hongjie Fang =?utf-8?B?KOaWuea0quadsCk=?= , "Eric W. Biederman" , linux-kernel@vger.kernel.org Subject: Re: [patch] mm, oom: add comment for why oom_adj exists Message-ID: <20151105102840.GA15111@dhcp22.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2277 Lines: 55 On Wed 04-11-15 12:32:14, David Rientjes wrote: > /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. I am not sure this is really needed but it certainly is not harmful. If this is a way to suppress any attempts for changes like http://lkml.kernel.org/r/1f80189385e540c2a5b2747a7a265d8c%40SHMBX01.spreadtrum.com then it does not explain why those are not desirable. > Signed-off-by: David Rientjes > --- > 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. This is a bit strong wording. I think the knob can be removed in the future. * oom_adj is kept for compatibility reasons. There are still few * projects which use oom_adj only. We have tried to convert all of them * which could be found but it will take some time until all those changes * bubble up to all users. We might try to remove the knob in few years * if the situtation changes. > + */ > static ssize_t oom_adj_write(struct file *file, const char __user *buf, > size_t count, loff_t *ppos) > { -- Michal Hocko SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/