linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Anand Mitra <anand.mitra@gmail.com>
To: David Rientjes <rientjes@google.com>
Cc: Prasad Joshi <prasadjoshi124@gmail.com>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC][PATCH 00/25]: Propagating GFP_NOFS inside __vmalloc()
Date: Fri, 11 Mar 2011 18:05:39 -0800	[thread overview]
Message-ID: <AANLkTiniwDx0wjYT439JSBuT=DA12OF_eAVQ782GfJ7W@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1103111258340.31216@chino.kir.corp.google.com>

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

On Fri, Mar 11, 2011 at 1:01 PM, David Rientjes <rientjes@google.com> wrote:
>
>
> You're going to run into trouble by hard-wiring __GFP_REPEAT into all of
> the pte allocations because if GFP_NOFS is used then direct reclaim will
> usually fail (see the comment for do_try_to_free_pages(): If the caller is
> !__GFP_FS then the probability of a failure is reasonably high) and, if
> it does so continuously, then the page allocator will loop forever.  This
> bit should probably be moved a level higher in your architecture changes
> to the caller passing GFP_KERNEL.
>

I'll repeat my understanding of the scenario you have pointed out to
make sure we have understood you correctly.

On the broad level the changes will cause a __GFP_NOFS flag to be
present in pte allocation which were earlier absent. The impact of
this is serious when both __GFP_REPEAT and __GFP_NOFS is set because

1) __GFP_NOFS will result in very few pages being reclaimed (can't go
   to the filesystems)
2) __GFP_REPEAT will cause both the reclaim and allocation to retry
   more aggressively if not indefinitely based on the influence the
   flag in functions should_alloc_retry & should_continue_reclaim

Effectively we need memory for use by the filesystem but we can't go
back to the filesystem to claim it. Without the suggested patch we
would actually try to claim space from the filesystem which would work
most of the times but would deadlock occasionally. With the suggested
patch as you have pointed out we can possibly get into a low memory
hang. I am not sure there is a way out of this, should this be
considered as genuinely low memory condition out of which the system
might or might not crawl out of ?

regards
-- 
Anand Mitra

[-- Attachment #2: Type: text/html, Size: 2346 bytes --]

  parent reply	other threads:[~2011-03-12  2:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11 20:35 Prasad Joshi
2011-03-11 21:01 ` David Rientjes
2011-03-11 21:13   ` Prasad Joshi
2011-03-11 23:08     ` David Rientjes
2011-03-12  2:05   ` Anand Mitra [this message]
2011-03-13  1:22     ` David Rientjes

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='AANLkTiniwDx0wjYT439JSBuT=DA12OF_eAVQ782GfJ7W@mail.gmail.com' \
    --to=anand.mitra@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=prasadjoshi124@gmail.com \
    --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