linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Andrea Arcangeli <andrea@suse.de>, Rik van Riel <riel@redhat.com>,
	linux-mm@kvack.org
Subject: Re: [patch 4/9] oom: add per-zone locking
Date: Thu, 20 Sep 2007 15:48:36 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.0.9999.0709201538310.2658@chino.kir.corp.google.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0709201522110.11627@schroedinger.engr.sgi.com>

On Thu, 20 Sep 2007, Christoph Lameter wrote:

> > But that races with another thread that is also trying an allocation 
> > attempt and you end up clearing the ZONE_OOM_LOCKED bits that it has 
> > already set in its call to try_set_zone_oom().
> 
> Well if you remember how far you got with locking and just undo those 
> then you are fine.
> 

No, you're not.

If you're locking your zones and find one that is already ZONE_OOM_LOCKED 
and then try to unlock those you've already done, you can race and another 
task in try_set_zone_oom() can fail because it found one of those zones 
that you're about to unlock.  Then both of these calls to 
try_set_zone_oom() return 0, both tasks are put to sleep, and the OOM 
killer is never called.

Granted, this will eventually work itself out but probably after putting 
each task to sleep several times and wasting plenty of time when we're in 
an OOM condition.

> The global lock there just spooks me. If a large number of processors get 
> in there (say 1000 or so in the case of a global oom) then there is 
> already an issue of getting the lock from node 0. The bits in the zone 
> are distributed over all of the nodes in the system.
> 

It's no more harder to acquire than callback_mutex was.  It's far better 
to include this global lock so the state of the zones are always correct 
after releasing it than to have 1000 processors clearing and setting 
ZONE_OOM_LOCKED bits for lengthy zonelists and all racing with each other 
so no zonelist is ever fully locked.

--
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:[~2007-09-20 22:48 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-20 20:23 [patch 0/9] oom killer serialization David Rientjes
2007-09-20 20:23 ` [patch 1/9] oom: move prototypes to appropriate header file David Rientjes
2007-09-20 20:23   ` [patch 2/9] oom: move constraints to enum David Rientjes
2007-09-20 20:23     ` [patch 3/9] oom: change all_unreclaimable zone member to flags David Rientjes
2007-09-20 20:23       ` [patch 4/9] oom: add per-zone locking David Rientjes
2007-09-20 20:23         ` [patch 5/9] oom: serialize out of memory calls David Rientjes
2007-09-20 20:23           ` [patch 6/9] oom: add oom_kill_asking_task sysctl David Rientjes
2007-09-20 20:23             ` [patch 7/9] oom: suppress extraneous stack and memory dump David Rientjes
2007-09-20 20:23               ` [patch 8/9] oom: compare cpuset mems_allowed instead of exclusive ancestors David Rientjes
2007-09-20 20:23                 ` [patch 9/9] oom: do not take callback_mutex David Rientjes
2007-09-20 22:04                   ` Christoph Lameter
2007-09-20 22:01                 ` [patch 8/9] oom: compare cpuset mems_allowed instead of exclusive ancestors Christoph Lameter
2007-09-20 22:00               ` [patch 7/9] oom: suppress extraneous stack and memory dump Christoph Lameter
2007-09-20 22:03             ` [patch 6/9] oom: add oom_kill_asking_task sysctl Christoph Lameter
2007-09-20 22:07               ` David Rientjes
2007-09-20 22:09                 ` Christoph Lameter
2007-09-21  9:05             ` Andrew Morton
2007-09-20 21:59           ` [patch 5/9] oom: serialize out of memory calls Christoph Lameter
2007-09-21  9:01           ` Andrew Morton
2007-09-21 20:04             ` David Rientjes
2007-09-20 21:59         ` [patch 4/9] oom: add per-zone locking Christoph Lameter
2007-09-20 22:03           ` David Rientjes
2007-09-20 22:05             ` Christoph Lameter
2007-09-20 22:12               ` David Rientjes
2007-09-20 22:26                 ` Christoph Lameter
2007-09-20 22:48                   ` David Rientjes [this message]
2007-09-21  8:59                     ` Andrew Morton
2007-09-20 21:56       ` [patch 3/9] oom: change all_unreclaimable zone member to flags Christoph Lameter
2007-09-20 21:58         ` David Rientjes
2007-09-21  8:55       ` Andrew Morton
2007-09-21  9:12 ` [patch 0/9] oom killer serialization Andrew Morton
2007-09-21  9:21   ` David Rientjes
2007-09-21 19:13     ` David Rientjes
2007-09-21 19:15   ` Christoph Lameter

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.0.9999.0709201538310.2658@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrea@suse.de \
    --cc=clameter@sgi.com \
    --cc=linux-mm@kvack.org \
    --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