linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@techsingularity.net>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Johannes Weiner <hannes@cmpxchg.org>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	David Rientjes <rientjes@google.com>
Subject: Re: [PATCH] mm, page_alloc: fallback to smallest page when not stealing whole pageblock
Date: Wed, 31 May 2017 09:31:45 +0100	[thread overview]
Message-ID: <20170531083145.2s5pk5zhkf2kh4ga@techsingularity.net> (raw)
In-Reply-To: <20170529093947.22618-1-vbabka@suse.cz>

On Mon, May 29, 2017 at 11:39:47AM +0200, Vlastimil Babka wrote:
> Since commit 3bc48f96cf11 ("mm, page_alloc: split smallest stolen page in
> fallback") we pick the smallest (but sufficient) page of all that have been
> stolen from a pageblock of different migratetype. However, there are cases when
> we decide not to steal the whole pageblock. Practically in the current
> implementation it means that we are trying to fallback for a MIGRATE_MOVABLE
> allocation of order X, go through the freelists from MAX_ORDER-1 down to X, and
> find free page of order Y. If Y is less than pageblock_order / 2, we decide not
> to steal all pages from the pageblock. When Y > X, it means we are potentially
> splitting a larger page than we need, as there might be other pages of order Z,
> where X <= Z < Y. Since Y is already too small to steal whole pageblock,
> picking smallest available Z will result in the same decision and we avoid
> splitting a higher-order page in a MIGRATE_UNMOVABLE or MIGRATE_RECLAIMABLE
> pageblock.
> 
> This patch therefore changes the fallback algorithm so that in the situation
> described above, we switch the fallback search strategy to go from order X
> upwards to find the smallest suitable fallback. In theory there shouldn't be
> a downside of this change wrt fragmentation.
> 
> This has been tested with mmtests' stress-highalloc performing GFP_KERNEL
> order-4 allocations, here is the relevant extfrag tracepoint statistics:
> 
>                                                       4.12.0-rc2      4.12.0-rc2
>                                                        1-kernel4       2-kernel4
> Page alloc extfrag event                                  25640976    69680977
> Extfrag fragmenting                                       25621086    69661364
> Extfrag fragmenting for unmovable                            74409       73204
> Extfrag fragmenting unmovable placed with movable            69003       67684
> Extfrag fragmenting unmovable placed with reclaim.            5406        5520
> Extfrag fragmenting for reclaimable                           6398        8467
> Extfrag fragmenting reclaimable placed with movable            869         884
> Extfrag fragmenting reclaimable placed with unmov.            5529        7583
> Extfrag fragmenting for movable                           25540279    69579693
> 
> Since we force movable allocations to steal the smallest available page (which
> we then practially always split), we steal less per fallback, so the number of
> fallbacks increases and steals potentially happen from different pageblocks.
> This is however not an issue for movable pages that can be compacted.
> 

Way back I was worried that more fragmenting events for movable like
this may lead to more unmovable fragmenting events and increase overall
fragmentation. At the time, it was also the case that I was mostly testing
32-bit and smaller memory sizes but that is now obviously different and the
mix of high-order allocation sizes has also changed considerably. Also,
while your data indicates there are more fragmenting events, there are
fewer for unmovable allocations so the data supports your position. Hence,
I can't backup by concerns other than with vague hand-waving about vague
recollections from 10 years ago so

Acked-by: Mel Gorman <mgorman@techsingularity.net>

-- 
Mel Gorman
SUSE Labs

--
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>

      reply	other threads:[~2017-05-31  8:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29  9:39 [PATCH] mm, page_alloc: fallback to smallest page when not stealing whole pageblock Vlastimil Babka
2017-05-31  8:31 ` Mel Gorman [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=20170531083145.2s5pk5zhkf2kh4ga@techsingularity.net \
    --to=mgorman@techsingularity.net \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    /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).