linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
	linux-mm@kvack.org,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Subject: Re: [patch] mm, oom: allow exiting tasks to have access to memory reserves
Date: Thu, 8 Mar 2012 13:59:31 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1203081353150.23632@chino.kir.corp.google.com> (raw)
In-Reply-To: <20120308120859.f7bc8cad.akpm@linux-foundation.org>

On Thu, 8 Mar 2012, Andrew Morton wrote:

> > It closes the risk of livelock if an oom killed thread, thread A, cannot 
> > exit because it's blocked on another thread, thread B, which cannot exit 
> > because it requires memory in the exit path and doesn't have access to 
> > memory reserves.  So this patch makes it more likely that an oom killed 
> > thread will be able to exit without livelocking.
> 
> But it also "allow to eat all of reserve memory and bring us new
> serious failure".  In theory, at least.
> 

Exactly, "in theory."  We've never seen an issue where a set of threads in 
do_exit() allocated memory at the same time to deplete all memory reserves 
while never freeing the memory so that reclaim consistently fails and all 
threads continue to enter into the oom killer to get access to memory 
reserves.

And, with the way the code is written before this patch, only one thread 
will have access to memory reserves and the oom killer will be a no-op 
until it exits.  There's a much higher liklihood that an oom killed thread 
may not exit because it's blocked on another thread that requires memory.  
That's what this patch addresses.

> And afaict the proposed patch is a theoretical thing as well.  Has
> anyone sat down and created tests to demonstrate either problem?

We've run with this patch internally for a year because an oom killed 
thread can't exit.  We used to address this with an oom killer timeout 
that would kill another thread only after 10s but it was much faster to 
just give access to memory reserves and to let them exit.

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2012-03-08 21:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07  2:25 David Rientjes
2012-03-07  6:39 ` KOSAKI Motohiro
2012-03-07  7:21   ` David Rientjes
2012-03-07  7:22     ` [patch v2] " David Rientjes
2012-03-08 20:08     ` [patch] " Andrew Morton
2012-03-08 21:59       ` David Rientjes [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=alpine.DEB.2.00.1203081353150.23632@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@gmail.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    /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