From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751929AbbKAEaW (ORCPT ); Sun, 1 Nov 2015 00:30:22 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:32965 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750782AbbKAEaS (ORCPT ); Sun, 1 Nov 2015 00:30:18 -0400 Date: Sat, 31 Oct 2015 21:30:15 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Andrew Morton , "Eric W. Biederman" cc: =?UTF-8?Q?Hongjie_Fang_=28=E6=96=B9=E6=B4=AA=E6=9D=B0=29?= , Michal Hocko , "linux-kernel@vger.kernel.org" Subject: =?UTF-8?Q?Re=3A_=E7=AD=94=E5=A4=8D=3A_=5BPATCHv2_4=2E3-rc6=5D_proc=3A_fix_convert_from_oom=5Fscore=5Fadj_to_oom=5Fadj?= In-Reply-To: <87eggeuyho.fsf@x220.int.ebiederm.org> Message-ID: References: <1f80189385e540c2a5b2747a7a265d8c@SHMBX01.spreadtrum.com> <5eff586de266418090f792077fcff993@SHMBX01.spreadtrum.com> <87eggeuyho.fsf@x220.int.ebiederm.org> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Oct 2015, Eric W. Biederman wrote: > > It's confusing, but with purpose: it shows there is no direct mapping > > between /proc/pid/oom_adj and /proc/pid/oom_score_adj. > > /proc/pid/oom_score_adj is the effective policy and has been for years. > > The value returned by /proc/pid/oom_adj demonstrates reality vs what is > > perceived and is a side-effect of integer division truncating the result > > in C. > > > > It's a bad situation, I agree, and we anticipated the complete removal of > > /proc/pid/oom_adj years ago since it has been deprecated for years. Maybe > > one day we can convince Linus that is possible, but until then we're stuck > > with it. > > If you really want to remove /proc/pid/oom_adj start by placing it in a > Kconfig so people can make it go away. > [+akpm] We've tried to remove it over the period of a couple of years after oom_score_adj was introduced. I believe we had a WARN_ON() for the first two years and then removed it all together. A few months later, there was a bug report because the file didn't exist and Linus insisted it be readded because we don't break userspace. I would absolutely love to remove oom_adj, but I'm afraid that it may not be possible.