Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1579611

Re: [PATCH v2 03/10] mm, page_alloc: split smallest stolen page in fallback

From Mel Gorman <mgorman@techsingularity.net>
Newsgroups linux.kernel
Subject Re: [PATCH v2 03/10] mm, page_alloc: split smallest stolen page in fallback
Date 2017-02-13 12:00 +0100
Message-ID <tamwq-2Cb-7@gated-at.bofh.it> (permalink)
References <t9nXA-6ZO-5@gated-at.bofh.it> <t9oTE-7BA-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Feb 10, 2017 at 06:23:36PM +0100, Vlastimil Babka wrote:
> The __rmqueue_fallback() function is called when there's no free page of
> requested migratetype, and we need to steal from a different one. There are
> various heuristics to make this event infrequent and reduce permanent
> fragmentation. The main one is to try stealing from a pageblock that has the
> most free pages, and possibly steal them all at once and convert the whole
> pageblock. Precise searching for such pageblock would be expensive, so instead
> the heuristics walks the free lists from MAX_ORDER down to requested order and
> assumes that the block with highest-order free page is likely to also have the
> most free pages in total.
> 
> Chances are that together with the highest-order page, we steal also pages of
> lower orders from the same block. But then we still split the highest order
> page. This is wasteful and can contribute to fragmentation instead of avoiding
> it.
> 

The original intent was that if an allocation request was stealing a
pageblock that taking the largest one would reduce the likelihood of a
steal in the near future by the same type.

> This patch thus changes __rmqueue_fallback() to just steal the page(s) and put
> them on the freelist of the requested migratetype, and only report whether it
> was successful. Then we pick (and eventually split) the smallest page with
> __rmqueue_smallest().  This all happens under zone lock, so nobody can steal it
> from us in the process. This should reduce fragmentation due to fallbacks. At
> worst we are only stealing a single highest-order page and waste some cycles by
> moving it between lists and then removing it, but fallback is not exactly hot
> path so that should not be a concern. As a side benefit the patch removes some
> duplicate code by reusing __rmqueue_smallest().
> 
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

But conceptually this is better so

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

-- 
Mel Gorman
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/10] try to reduce fragmenting fallbacks Vlastimil Babka <vbabka@suse.cz> - 2017-02-10 20:20 +0100
  [PATCH v2 03/10] mm, page_alloc: split smallest stolen page in fallback Vlastimil Babka <vbabka@suse.cz> - 2017-02-10 20:20 +0100
    Re: [PATCH v2 03/10] mm, page_alloc: split smallest stolen page in  fallback Mel Gorman <mgorman@techsingularity.net> - 2017-02-13 12:00 +0100
      Re: [PATCH v2 03/10] mm, page_alloc: split smallest stolen page in  fallback Vlastimil Babka <vbabka@suse.cz> - 2017-02-13 12:00 +0100
    Re: [PATCH v2 03/10] mm, page_alloc: split smallest stolen page in  fallback Johannes Weiner <hannes@cmpxchg.org> - 2017-02-14 18:10 +0100
  [PATCH v2 01/10] mm, compaction: reorder fields in struct compact_control Vlastimil Babka <vbabka@suse.cz> - 2017-02-10 20:20 +0100
    Re: [PATCH v2 01/10] mm, compaction: reorder fields in struct  compact_control Mel Gorman <mgorman@techsingularity.net> - 2017-02-13 11:50 +0100
    Re: [PATCH v2 01/10] mm, compaction: reorder fields in struct  compact_control Johannes Weiner <hannes@cmpxchg.org> - 2017-02-14 17:40 +0100
  [PATCH v2 06/10] mm, compaction: add migratetype to compact_control Vlastimil Babka <vbabka@suse.cz> - 2017-02-10 20:20 +0100
    Re: [PATCH v2 06/10] mm, compaction: add migratetype to  compact_control Mel Gorman <mgorman@techsingularity.net> - 2017-02-13 12:00 +0100
    Re: [PATCH v2 06/10] mm, compaction: add migratetype to  compact_control Johannes Weiner <hannes@cmpxchg.org> - 2017-02-14 19:20 +0100
  [PATCH v2 02/10] mm, compaction: remove redundant watermark check in compact_finished() Vlastimil Babka <vbabka@suse.cz> - 2017-02-10 20:20 +0100
    Re: [PATCH v2 02/10] mm, compaction: remove redundant watermark  check in compact_finished() Mel Gorman <mgorman@techsingularity.net> - 2017-02-13 11:50 +0100
    Re: [PATCH v2 02/10] mm, compaction: remove redundant watermark  check in compact_finished() Johannes Weiner <hannes@cmpxchg.org> - 2017-02-14 17:40 +0100
  Re: [PATCH v2 00/10] try to reduce fragmenting fallbacks Mel Gorman <mgorman@techsingularity.net> - 2017-02-13 12:10 +0100
    Re: [PATCH v2 00/10] try to reduce fragmenting fallbacks Vlastimil Babka <vbabka@suse.cz> - 2017-02-15 15:40 +0100
      Re: [PATCH v2 00/10] try to reduce fragmenting fallbacks Vlastimil Babka <vbabka@suse.cz> - 2017-02-15 17:20 +0100
        Re: [PATCH v2 00/10] try to reduce fragmenting fallbacks Vlastimil Babka <vbabka@suse.cz> - 2017-02-15 21:20 +0100
      Re: [PATCH v2 00/10] try to reduce fragmenting fallbacks Vlastimil Babka <vbabka@suse.cz> - 2017-02-16 16:20 +0100
        Re: [PATCH v2 00/10] try to reduce fragmenting fallbacks Vlastimil Babka <vbabka@suse.cz> - 2017-02-17 16:30 +0100
    Re: [PATCH v2 00/10] try to reduce fragmenting fallbacks Vlastimil Babka <vbabka@suse.cz> - 2017-02-20 13:40 +0100
      Re: [PATCH v2 00/10] try to reduce fragmenting fallbacks Mel Gorman <mgorman@techsingularity.net> - 2017-02-23 17:10 +0100

csiph-web