Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031687AbbKFDwZ (ORCPT ); Thu, 5 Nov 2015 22:52:25 -0500 Received: from out4133-34.mail.aliyun.com ([42.120.133.34]:25367 "EHLO out4133-34.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031204AbbKFDwY (ORCPT ); Thu, 5 Nov 2015 22:52:24 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03282;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=7;SR=0; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "David Rientjes" Cc: "Andrew Morton" , "Michal Hocko" , "linux-kernel" , , , "'Eric W. Biederman'" Subject: Re: [patch] mm, oom: add comment for why oom_adj exists Date: Fri, 06 Nov 2015 11:52:01 +0800 Message-ID: <009801d11846$7eb2f610$7c18e230$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdEYRjsEVV1vmEDNTOaj/9vgL2Eaqg== Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1604 Lines: 42 > > /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 > --- Acked-by: Hillf Danton > 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 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/