linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "KAMEZAWA Hiroyuki" <kamezawa.hiroyu@jp.fujitsu.com>
To: David Rientjes <rientjes@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	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 10:10:49 +0900 (JST)	[thread overview]
Message-ID: <77df8765230d9f83859fde3119a2d60a.squirrel@webmail-b.css.fujitsu.com> (raw)
In-Reply-To: <alpine.DEB.2.00.0907311212240.22732@chino.kir.corp.google.com>

David Rientjes wrote:

>> > It livelocks if a thread is chosen and passed to oom_kill_task() while
>> > another per-thread oom_adj value is OOM_DISABLE for a thread sharing
>> the
>> > same memory.
>> >
>> I say "why don't modify buggy selection logic?"
>>
>> Why we have to scan all threads ?
>> As fs/proc/readdir does, you can scan only "process group leader".
>>
>> per-thread scan itself is buggy because now we have per-process
>> effective-oom-adj.
>>
>
> Without my patches to change oom_adj from task_struct to mm_struct, you'd
> need to scan all tasks and not just the tgids because their oom_adj values
> can differ amongst threads in the same thread group.  So while it may now
> be possible to shorten the scan as a result of my approach, it isn't a
> solution itself to the problem.

Did I said "revert your patch in -rc" even once ?
livelock-avoidance itself is good work, thank you.
All my suggestion is based on your patch already in rc4.
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.



>
>> > How else do you propose the oom killer use oom_adj values on a
>> per-thread
>> > basis without considering other threads sharing the same memory?
>> As I wrote.
>>    per-process(signal struct) or per-thread oom_adj and add
>>    mm->effecitve_oom_adj
>>
>> task scanning isn't necessary to do per-thread scan and you can scan
>> only process-group-leader. What's bad ?
>> If oom_score is problem, plz fix it to show effective_oom_score.
>>
>
> When only using (and showing) mm->effective_oom_adj for a task, userspace
> will not be able to adjust /proc/pid/oom_score with /proc/pid/oom_adj
> as Documentation/filesystems/proc.txt says you can for a thread unless it
> exceeds effective_oom_adj.>

Is it different from old behavior ?
I think documentation is wrong. It should say "you should think of
multi-thread effect to oom_adj/oom_score".

Thanks,
-Kame

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


--
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  1:10 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 [this message]
2009-08-01 20:26                   ` David Rientjes
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=77df8765230d9f83859fde3119a2d60a.squirrel@webmail-b.css.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --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 \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox