linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Rik van Riel <riel@redhat.com>, Paul Menage <menage@google.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch -mm v2] mm: introduce oom_adj_child
Date: Sat, 1 Aug 2009 13:26:52 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.0908011303050.22174@chino.kir.corp.google.com> (raw)
In-Reply-To: <77df8765230d9f83859fde3119a2d60a.squirrel@webmail-b.css.fujitsu.com>

On Sat, 1 Aug 2009, KAMEZAWA Hiroyuki wrote:

> Summarizing I think now .....
>   - rename mm->oom_adj as mm->effective_oom_adj
>   - re-add per-thread oom_adj
>   - update mm->effective_oom_adj based on per-thread oom_adj
>   - if necessary, plz add read-only /proc/pid/effective_oom_adj file.
>     or show 2 values in /proc/pid/oom_adj
>   - rewrite documentation about oom_score.
>    " it's calclulated from  _process's_ memory usage and oom_adj of
>     all threads which shares a memor  context".
>    This behavior is not changed from old implemtation, anyway.
>  - If necessary, rewrite oom_kill itself to scan only thread group
>    leader. It's a way to go regardless of  vfork problem.
> 

Ok, so you've abandoned the signal_struct proposal and now want to add it 
back to task_struct with an effective member in mm_struct by changing the 
documentation.  Hmm.

This solves the livelock problem by adding additional tunables, but 
doesn't match how the documentation describes the use case for 
/proc/pid/oom_adj.  Your argument is that the behavior of that value can't 
change: that it must be per-thread.  And that allowance leads to one of 
two inconsistent scenarios:

 - /proc/pid/oom_score is inconsistent when tuning /proc/pid/oom_adj if it
   relies on the per-thread oom_adj; it now really represents nothing but
   an incorrect value if other threads share that memory and misleads the
   user on how the oom killer chooses victims, or

 - /proc/pid/oom_score is inconsistent when the thread that set the
   effective per-mm oom_adj exits and it is now obsolete since you have
   no way to determine what the next effective oom_adj value shall be.

Determining the next effective per-mm oom_adj isn't possible when the only 
threads sharing the mm remaining have different per-thread oom_adj values.  
That's a horribly inconsistent state to be getting into because it allows 
oom_score to change when a thread exits, which is completely unknown to 
userspace, OR is allows the effective per-mm oom_adj to be different from 
all threads sharing the same memory (and, thus, /proc/pid/oom_score not 
being representative of any thread's /proc/pid/oom_adj).

> I think documentation is wrong. It should say "you should think of
> multi-thread effect to oom_adj/oom_score".
> 

It's more likely than not that applications were probably written to the 
way the documentation described the two files: that is, adjust 
/proc/pid/oom_score by tuning /proc/pid/oom_adj instead of relying on an 
undocumented implementation detail concerning the tuning of oom_adj for a 
vfork'd child prior to exec().  The user is probably unaware of the oom 
killer's implementation and simply interprets a higher oom_score as a more 
likely candidate for oom kill.  My patches preserve that in all scenarios 
without altering the documentation or adding additional files that would 
be required to leave the oom_adj value itself in an inconsistent state as 
you propose.

--
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>

  reply	other threads:[~2009-08-01 20:20 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-29  4:27 David Rientjes
2009-07-29 23:13 ` Andrew Morton
2009-07-29 23:25   ` Paul Menage
2009-07-30  2:32 ` KOSAKI Motohiro
2009-07-30  7:06   ` David Rientjes
2009-07-31  6:47     ` KOSAKI Motohiro
2009-07-31  9:31       ` David Rientjes
2009-08-03 11:58         ` KOSAKI Motohiro
2009-08-03 12:12           ` KOSAKI Motohiro
2009-07-30  9:00 ` KAMEZAWA Hiroyuki
2009-07-30  9:31   ` David Rientjes
2009-07-30 10:02     ` KAMEZAWA Hiroyuki
2009-07-30 19:05       ` David Rientjes
2009-07-31  0:33         ` KAMEZAWA Hiroyuki
2009-07-31  6:50           ` KOSAKI Motohiro
2009-07-31 19:38             ` David Rientjes
2009-08-03 12:16               ` KOSAKI Motohiro
2009-07-31  9:36           ` David Rientjes
2009-07-31 10:49             ` KAMEZAWA Hiroyuki
2009-07-31 19:18               ` David Rientjes
2009-08-01  1:10                 ` KAMEZAWA Hiroyuki
2009-08-01 20:26                   ` David Rientjes [this message]
2009-08-03  1:42                     ` KAMEZAWA Hiroyuki
2009-08-03  7:59                       ` David Rientjes
2009-08-03  8:02                         ` KAMEZAWA Hiroyuki
2009-08-03  8:08                           ` David Rientjes
2009-08-03  8:45                             ` KAMEZAWA Hiroyuki
2009-08-03  8:55                               ` KAMEZAWA Hiroyuki
2009-08-03 12:19                                 ` KOSAKI Motohiro
2009-08-03 12:32                         ` KOSAKI Motohiro
2009-08-03 12:21                     ` KOSAKI Motohiro
2009-08-03 16:17                     ` Paul Menage

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=alpine.DEB.2.00.0908011303050.22174@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=menage@google.com \
    --cc=riel@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox