All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: David Rientjes <rientjes@google.com>
Cc: "Hongjie Fang (方洪杰)" <Hongjie.Fang@spreadtrum.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv2 4.3-rc6] proc: fix convert from oom_score_adj to oom_adj
Date: Tue, 27 Oct 2015 13:37:04 +0100	[thread overview]
Message-ID: <20151027123704.GH9891@dhcp22.suse.cz> (raw)
In-Reply-To: <alpine.DEB.2.10.1510261439570.12408@chino.kir.corp.google.com>

On Mon 26-10-15 14:42:57, David Rientjes wrote:
> On Thu, 22 Oct 2015, Hongjie Fang (方洪杰) wrote:
> 
> > 
> > The oom_adj has been replaced by oom_score_adj in kernel,
> > but the /proc/pid/oom_adj is provided for legacy purposes.
> > When write/read a value into/from /proc/pid/oom_adj,
> > there is a transformation between oom_adj and oom_score_adj.
> > 
> > After writing a new value into /proc/pid/oom_adj, then read it.
> > The return value is a different value than you wrote.
> > Fix this by adding a adjustment factor.
> > 
> 
> You're only looking at the output and seeing that it disagrees with what 
> was written and ignoring _why_ it disagrees.
> 
> It's because, as I already stated, oom_score_adj is the effective tunable 
> for oom kill process prioritization and the legacy oom_adj had a different 
> scale where a 1:1 mapping is not possible.
> 
> All throughout the kernel, we report the effective value.  We accept 
> writes and the reads report the effective value.  This is no different.
> 
> Nack again.

I really fail to understand your reasoning. The patch basically fixes up
the presented value of oom_adj after rounding imprecision. It doesn't
change the way how the oom_adj->oom_score_aj mapping is done at all. All
it does is that it presents oom_adj1 -> oom_score_adj -> oom_adj2 and
oom_adj1 = oom_adj2

How can this be any harmful? And more importantly why do you want to
expose the imprecision in the mapping to the user space in the first
place?
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2015-10-27 12:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22  6:49 [PATCHv2 4.3-rc6] proc: fix convert from oom_score_adj to oom_adj Hongjie Fang (方洪杰)
2015-10-22  9:47 ` Michal Hocko
2015-10-26 21:42 ` David Rientjes
2015-10-27 12:37   ` Michal Hocko [this message]
     [not found]   ` <5eff586de266418090f792077fcff993@SHMBX01.spreadtrum.com>
2015-10-28 23:54     ` 答复: " David Rientjes
2015-10-29  3:47       ` Eric W. Biederman
2015-11-01  4:30         ` David Rientjes
2015-10-29 17:04       ` Michal Hocko
2015-10-30 12:59         ` Michal Hocko
2015-10-30 14:46           ` Michal Hocko
2015-11-01  4:38             ` David Rientjes
2015-11-02 13:08               ` Michal Hocko
2015-11-02 17:18               ` Dave Jones
2015-11-02 20:24                 ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151027123704.GH9891@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=Hongjie.Fang@spreadtrum.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.