From: Mel Gorman <mgorman@techsingularity.net>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Linux-MM <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
David Rientjes <rientjes@google.com>,
Andrea Arcangeli <aarcange@redhat.com>,
Zi Yan <zi.yan@cs.rutgers.edu>, Michal Hocko <mhocko@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/4] mm: Reclaim small amounts of memory when an external fragmentation event occurs
Date: Thu, 22 Nov 2018 16:22:28 +0000 [thread overview]
Message-ID: <20181122162228.GL23260@techsingularity.net> (raw)
In-Reply-To: <c65bf59a-1134-0fc8-5718-dbd6752fa851@suse.cz>
On Thu, Nov 22, 2018 at 04:35:58PM +0100, Vlastimil Babka wrote:
> >> I think I don't understand this comment :( Do you want to avoid waking
> >> up kswapd from steal_suitable_fallback() (introduced above) for
> >> allocations without __GFP_KSWAPD_RECLAIM? But returning 0 here means
> >> actually allowing the allocation go through steal_suitable_fallback()?
> >> So should it return ALLOC_NOFRAGMENT below, or was the intent different?
> >>
> >
> > I want to avoid waking kswapd in steal_suitable_fallback if waking
> > kswapd is not allowed.
>
> OK, but then this 'if' should return ALLOC_NOFRAGMENT, not 0?
> But that will still not prevent waking kswapd for nodes where there's no
> ZONE_DMA32, or any node when get_page_from_freelist() retries without
> fallback.
>
> > If the calling context does not allow it, it does
> > mean that fragmentation will be allowed to occur. I'm banking on it
> > being a relatively rare case but potentially it'll be problematic. The
> > main source of allocation requests that I expect to hit this are THP and
> > as they are already at pageblock_order, it has limited impact from a
> > fragmentation perspective -- particularly as pageblock_order stealing is
> > allowed even with ALLOC_NOFRAGMENT.
>
> Yep, THP will skip the wakeup in steal_suitable_fallback() via 'goto
> single_page' above it. For other users of ~__GFP_KSWAPD_RECLAIM (are
> there any?) we could maybe just ignore and wakeup kswapd anyway, since
> avoiding fragmentation is more important? Or if we wanted to avoid
> wakeup reliably, then steal_suitable_fallback() would have to know and
> check gfp_flags I'm afraid, and that doesn't seem worth the trouble.
Indeed. While it works in some cases, it'll be full of holes and while
I could close them, it just turns into a subtle mess. I've prepared a
preparation path that encodes __GFP_KSWAPD_RECLAIM in alloc_flags and checks
based on that. It's a lot cleaner overall, it's less of a mess than passing
gfp_flags all the way through for one test and there are fewer side-effects.
Thanks!
--
Mel Gorman
SUSE Labs
next prev parent reply other threads:[~2018-11-22 16:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-21 10:14 [PATCH 0/4] Fragmentation avoidance improvements v4 Mel Gorman
2018-11-21 10:14 ` [PATCH 1/4] mm, page_alloc: Spread allocations across zones before introducing fragmentation Mel Gorman
2018-11-21 14:18 ` Vlastimil Babka
2018-11-21 14:31 ` Mel Gorman
2018-11-21 10:14 ` [PATCH 2/4] mm: Move zone watermark accesses behind an accessor Mel Gorman
2018-11-21 22:07 ` Vlastimil Babka
2018-11-21 10:14 ` [PATCH 3/4] mm: Reclaim small amounts of memory when an external fragmentation event occurs Mel Gorman
2018-11-22 13:53 ` Vlastimil Babka
2018-11-22 15:04 ` Mel Gorman
2018-11-22 15:35 ` Vlastimil Babka
2018-11-22 16:22 ` Mel Gorman [this message]
2018-11-21 10:14 ` [PATCH 4/4] mm: Stall movable allocations until kswapd progresses during serious external fragmentation event Mel Gorman
2018-11-22 17:02 ` Vlastimil Babka
2018-11-22 19:10 ` Mel Gorman
-- strict thread matches above, loose matches on Subject: below --
2018-11-08 9:12 [PATCH 0/4] Fragmentation avoidance improvements v3 Mel Gorman
2018-11-08 9:12 ` [PATCH 3/4] mm: Reclaim small amounts of memory when an external fragmentation event occurs 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=20181122162228.GL23260@techsingularity.net \
--to=mgorman@techsingularity.net \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=rientjes@google.com \
--cc=vbabka@suse.cz \
--cc=zi.yan@cs.rutgers.edu \
/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).