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: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] memcg: page fault oom improvement v2
Date: Tue, 23 Feb 2010 14:49:12 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1002231443410.8693@chino.kir.corp.google.com> (raw)
In-Reply-To: <20100223160714.72520b48.kamezawa.hiroyu@jp.fujitsu.com>

On Tue, 23 Feb 2010, KAMEZAWA Hiroyuki wrote:

> Ouch, I missed to add memcontrol.h to quilt's reflesh set..
> This is updated one. Anyway, I'd like to wait for the next mmotm.
> We already have several changes. 
> 

I think it would be better to just remove mem_cgroup_out_of_memory() and 
make it go through out_of_memory() by specifying a non-NULL pointer to a 
struct mem_cgroup.  We don't need the duplication in code that these two 
functions have and then we can begin to have some consistency with how to 
deal with panic_on_oom.

It would be much better to prefer killing current in pagefault oom 
conditions, as the final patch in my oom killer rewrite does, if it is 
killable.  If not, we scan the tasklist and find another suitable 
candidate.  If current is bound to a memcg, we pass that to 
select_bad_process() so that we only kill other tasks from the same 
cgroup.

This allows us to hijack the TIF_MEMDIE bit to detect when there is a 
parallel pagefault oom killing when the oom killer hasn't necessarily been 
invoked to kill a system-wide task (it's simply killing current, by 
default, and giving it access to memory reserves).  Then, we can change 
out_of_memory(), which also now handles memcg oom conditions, to always 
scan the tasklist first (including for mempolicy and cpuset constrained 
ooms), check for any candidates that have TIF_MEMDIE, and return 
ERR_PTR(-1UL) if so.  That catches the parallel pagefault oom conditions 
from needlessly killing memcg tasks.  panic_on_oom would only panic after 
the tasklist scan has completed and returned != ERR_PTR(-1UL), meaning 
pagefault ooms are exempt from that sysctl.

Anyway, do you think it would be possible to rebase on mmotm with my oom 
killer rewrite patches?  They're at 
http://www.kernel.org/pub/linux/kernel/people/rientjes/oom-killer-rewrite

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

  parent reply	other threads:[~2010-02-23 22:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-23  3:03 [RFC][PATCH] memcg: page fault oom improvement KAMEZAWA Hiroyuki
2010-02-23  5:02 ` Daisuke Nishimura
2010-02-23  6:21   ` Daisuke Nishimura
2010-02-23  6:26     ` [RFC][PATCH] memcg: page fault oom improvement v2 KAMEZAWA Hiroyuki
2010-02-23  6:55       ` Daisuke Nishimura
2010-02-23  7:07         ` KAMEZAWA Hiroyuki
2010-02-23  8:38           ` KAMEZAWA Hiroyuki
2010-02-23 11:00             ` Daisuke Nishimura
2010-02-23 23:58               ` KAMEZAWA Hiroyuki
2010-02-23 22:49           ` David Rientjes [this message]
2010-02-24  0:08             ` KAMEZAWA Hiroyuki
2010-02-24  1:42               ` David Rientjes
2010-02-24  1:48                 ` KAMEZAWA Hiroyuki
2010-02-24  2:26                   ` David Rientjes
2010-02-24  2:25                     ` KAMEZAWA Hiroyuki
2010-02-23  6:10 ` [RFC][PATCH] memcg: page fault oom improvement Balbir Singh
2010-02-23  6:12   ` KAMEZAWA Hiroyuki

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.1002231443410.8693@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    /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