From: David Rientjes <rientjes@google.com>
To: Anand Mitra <anand.mitra@gmail.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: Sat, 12 Mar 2011 17:22:37 -0800 (PST) [thread overview]
Message-ID: <alpine.DEB.2.00.1103121717500.10317@chino.kir.corp.google.com> (raw)
In-Reply-To: <AANLkTiniwDx0wjYT439JSBuT=DA12OF_eAVQ782GfJ7W@mail.gmail.com>
On Fri, 11 Mar 2011, Anand Mitra wrote:
> 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
>
Yes, __GFP_REPEAT will loop in the page allocator forever if no pages can
be reclaimed, probably as the result of being !__GFP_FS -- the oom killer
also won't kill any processes to free memory because it requires __GFP_FS
(to ensure we don't kill something unnecessarily just because this
allocation is !__GFP_FS and direct reclaim has a high liklihood of
failure).
> 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 ?
>
As suggested in my email, I think you should pass "GFP_KERNEL |
__GFP_REPEAT" into the lower level functions in this patchset instead of
just GFP_KERNEL and not hard-wire __GFP_REPEAT into the lower level
functions. GFP_NOFS | __GFP_REPEAT is a very risky combination that
shouldn't be used anywhere in the kernel because it risks infinitely
looping in the page allocator when memory is low. The callers passing
only GFP_NOFS should handle the possiblity of returning NULL
appropraitely.
--
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>
prev parent reply other threads:[~2011-03-13 1:22 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
2011-03-13 1:22 ` 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.1103121717500.10317@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=anand.mitra@gmail.com \
--cc=linux-mm@kvack.org \
--cc=prasadjoshi124@gmail.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