public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: nigel@suspend2.net, LKML <linux-kernel@vger.kernel.org>,
	Nick Piggin <piggin@cyberone.com.au>, Mel Gorman <mel@skynet.ie>
Subject: Re: [PATCH] Should GFP_ATOMIC fail when we're below low watermark?
Date: Mon, 20 Aug 2007 09:09:33 -0700	[thread overview]
Message-ID: <20070820090933.09d80d4c.randy.dunlap@oracle.com> (raw)
In-Reply-To: <1187607961.6114.191.camel@twins>

On Mon, 20 Aug 2007 13:06:01 +0200 Peter Zijlstra wrote:

> On Mon, 2007-08-20 at 20:55 +1000, Nigel Cunningham wrote:
> > Hi.
> > 
> > On Monday 20 August 2007 18:59:36 Peter Zijlstra wrote:
> > > On Mon, 2007-08-20 at 18:38 +1000, Nigel Cunningham wrote:
> > > > Hi.
> > > > 
> > > > On Monday 20 August 2007 12:43:50 Peter Zijlstra wrote:
> > > > > On Mon, 2007-08-20 at 11:38 +1000, Nigel Cunningham wrote:
> > > > > > Hi all.
> > > > > > 
> > > > > > In current git (and for a while now), an attempt to allocate memory 
> > with 
> > > > > > GFP_ATOMIC will fail if we're below the low watermark level. The only 
> > way 
> > > > to 
> > > > > > access that memory that I can see (not that I've looked that hard) is 
> > to 
> > > > have 
> > > > > > PF_MEMALLOC set (ie from kswapd). I'm wondering if this behaviour is 
> > > > correct. 
> > > > > > Shouldn't GFP_ATOMIC allocations ignore watermarks too? How about 
> > > > GFP_KERNEL?
> > > > > > 
> > > > > > The following patch is a potential fix for GFP_ATOMIC.
> > > > > 
> > > > > Sorry, no.
> > > > > 
> > > > > GFP_ATOMIC must fail when below the watermark. GFP_KERNEL has __GFP_WAIT
> > > > > and hence can sleep and wait for reclaim so that should not be a problem
> > > > > (usually).
> > > > > 
> > > > > GFP_ATOMIC may not access the reserves because the reserves are needed
> > > > > to get out of OOM deadlocks within the VM. Consider the fact that
> > > > > freeing memory needs memory - if there is no memory free, you cannot
> > > > > free memory and you're pretty much stuck.
> > > > 
> > > > I guess, then, the question should be whether the watermark values are 
> > > > appropriate. Do we need high order allocations watermarked if this is the 
> > > > only purpose, particularly considering that whatever memory is allocated 
> > for 
> > > > this purpose is essentially useless 99.9% of the time?
> > > 
> > > Could you perhaps explain what you're trying to do? No matter what we
> > > do, GFP_ATOMIC will fail eventually, there is only so much one can do
> > > without blocking.
> > > 
> > > As for higher order allocations, until we have a full online defrag
> > > solution those too can fail at any moment (even with __GFP_WAIT).
> > 
> > I was just trying to make hibernation more reliable in sitations where there's 
> > low amounts of memory available. I guess the amount of memory that's reserved 
> > for this has increased, because some users have been reporting issues that 
> > hadn't appeared before. No problem. I'll work around it.
> 
> I think the last time the default reserves were changed was 2.6.12 or
> there about.
> 
> Perhaps Mel fiddled with it in .23-rc ?

Could there be a slab vs. slub difference?

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

  parent reply	other threads:[~2007-08-20 16:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-20  1:38 [PATCH] Should GFP_ATOMIC fail when we're below low watermark? Nigel Cunningham
2007-08-20  2:43 ` Peter Zijlstra
2007-08-20  8:38   ` Nigel Cunningham
2007-08-20  8:59     ` Peter Zijlstra
2007-08-20 10:55       ` Nigel Cunningham
2007-08-20 11:06         ` Peter Zijlstra
2007-08-20 11:41           ` Nigel Cunningham
2007-08-20 16:09           ` Randy Dunlap [this message]
2007-08-21 11:02           ` Mel Gorman
2007-08-20 19:11         ` Rafael J. Wysocki
2007-08-21 11:03         ` Mel Gorman

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=20070820090933.09d80d4c.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mel@skynet.ie \
    --cc=nigel@suspend2.net \
    --cc=peterz@infradead.org \
    --cc=piggin@cyberone.com.au \
    /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