From: Dave Chinner <david@fromorbit.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: David Rientjes <rientjes@google.com>,
Michal Hocko <mhocko@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [patch] mm: memcg: do not declare OOM from __GFP_NOFAIL allocations
Date: Wed, 4 Dec 2013 15:34:17 +1100 [thread overview]
Message-ID: <20131204043417.GM10988@dastard> (raw)
In-Reply-To: <20131204030101.GV3556@cmpxchg.org>
On Tue, Dec 03, 2013 at 10:01:01PM -0500, Johannes Weiner wrote:
> On Tue, Dec 03, 2013 at 03:40:13PM -0800, David Rientjes wrote:
> > On Tue, 3 Dec 2013, Johannes Weiner wrote:
> > I believe the page allocator would be susceptible to the same deadlock if
> > nothing else on the system can reclaim memory and that belief comes from
> > code inspection that shows __GFP_NOFAIL is not guaranteed to ever succeed
> > in the page allocator as their charges now are (with your patch) in memcg.
> > I do not have an example of such an incident.
>
> Me neither.
Is this the sort of thing that you expect to see when GFP_NOFS |
GFP_NOFAIL type allocations continualy fail?
http://oss.sgi.com/archives/xfs/2013-12/msg00095.html
XFS doesn't use GFP_NOFAIL, it does it's own loop with GFP_NOWARN in
kmem_alloc() so that if we get stuck for more than 100 attempts to
allocate it throws a warning. i.e. only when we really are stuck and
reclaim is not making any progress.
This specific case is due to memory fragmentation preventing a 64k
memory allocation (due to the filesystem being configured with a 64k
directory block size), but GFP_NOFS | GFP_NOFAIL allocations happen
*all the time* in filesystems.
> > > > So, my question again: why not bypass the per-zone min watermarks in the
> > > > page allocator?
> > >
> > > I don't even know what your argument is supposed to be. The fact that
> > > we don't do it in the page allocator means that there can't be a bug
> > > in memcg?
> > >
> >
> > I'm asking if we should allow GFP_NOFS | __GFP_NOFAIL allocations in the
> > page allocator to bypass per-zone min watermarks after reclaim has failed
> > since the oom killer cannot be called in such a context so that the page
> > allocator is not susceptible to the same deadlock without a complete
> > depletion of memory reserves?
>
> Yes, I think so.
There be dragons. If memcg's deadlock in low memory conditions in
the presence of GFP_NOFS | GFP_NOFAIL allocations, then we need to
make the memcg reclaim design more robust, not work around it by
allowing filesystems to drain critical memory reserves needed for
other situations....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
--
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>
next prev parent reply other threads:[~2013-12-04 4:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 17:17 [patch] mm: memcg: do not declare OOM from __GFP_NOFAIL allocations Johannes Weiner
2013-11-27 1:01 ` David Rientjes
2013-11-27 3:33 ` David Rientjes
2013-11-27 16:39 ` Johannes Weiner
2013-11-27 21:38 ` David Rientjes
2013-11-27 22:53 ` Johannes Weiner
2013-11-27 23:34 ` David Rientjes
2013-11-28 10:20 ` Michal Hocko
2013-11-29 23:46 ` David Rientjes
2013-12-02 13:22 ` Michal Hocko
2013-12-02 23:02 ` David Rientjes
2013-12-03 22:25 ` Johannes Weiner
2013-12-03 23:40 ` David Rientjes
2013-12-04 3:01 ` Johannes Weiner
2013-12-04 4:34 ` Dave Chinner [this message]
2013-12-04 5:25 ` Johannes Weiner
2013-12-04 6:10 ` 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=20131204043417.GM10988@dastard \
--to=david@fromorbit.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
--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;
as well as URLs for NNTP newsgroup(s).