linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: balbir@linux.vnet.ibm.com
Cc: "nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
	rientjes@google.com, "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] memcg: page fault oom improvement
Date: Tue, 23 Feb 2010 15:12:25 +0900	[thread overview]
Message-ID: <20100223151225.e7fdadc5.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20100223061020.GH3063@balbir.in.ibm.com>

On Tue, 23 Feb 2010 11:40:20 +0530
Balbir Singh <balbir@linux.vnet.ibm.com> wrote:

> * KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2010-02-23 12:03:15]:
> 
> > Nishimura-san, could you review and test your extreme test case with this ?
> > 
> > ==
> > From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> > 
> > Now, because of page_fault_oom_kill, returning VM_FAULT_OOM means
> > random oom-killer should be called. Considering memcg, it handles
> > OOM-kill in its own logic, there was a problem as "oom-killer called
> > twice" problem.
> > 
> > By commit a636b327f731143ccc544b966cfd8de6cb6d72c6, I added a check
> > in pagefault_oom_killer shouldn't kill some (random) task if
> > memcg's oom-killer already killed anyone.
> > That was done by comapring current jiffies and last oom jiffies of memcg.
> > 
> > I thought that easy fix was enough, but Nishimura could write a test case
> > where checking jiffies is not enough. So, my fix was not enough.
> > This is a fix of above commit.
> > 
> > This new one does this.
> >  * memcg's try_charge() never returns -ENOMEM if oom-killer is allowed.
> >  * If someone is calling oom-killer, wait for it in try_charge().
> >  * If TIF_MEMDIE is set as a result of try_charge(), return 0 and
> >    allow process to make progress (and die.) 
> >  * removed hook in pagefault_out_of_memory.
> > 
> > By this, pagefult_out_of_memory will be never called if memcg's oom-killer
> > is called and scattered codes are now in memcg's charge logic again.
> > 
> > TODO:
> >  If __GFP_WAIT is not specified in gfp_mask flag, VM_FAULT_OOM will return
> >  anyway. We need to investigate it whether there is a case.
> > 
> > Cc: David Rientjes <rientjes@google.com>
> > Cc: Balbir Singh <balbir@in.ibm.com>
> > Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
> > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> 
> I've not reviewed David's latest OOM killer changes. Are these changes based on top of
> what is going to come in with David's proposal?

About this change. no. This is an independent patch.
But through these a few month work, I(we) noticed page_fault_out_of_memory() is
dangerous and VM_FALUT_OOM should not be returned as much as possible.
About memcg, it's not necessary to return VM_FAULT_OOM when we know oom-killer
is called.

This fix itself is straightforward. But difficult thing here is test case, I think.

Thanks,
-Kame


--
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:[~2010-02-23  6:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-23  3:03 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
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 [this message]

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=20100223151225.e7fdadc5.kamezawa.hiroyu@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    --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