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


Groups > linux.kernel > #1213822

Re: [PATCH 11/12] mm, page_alloc: Reserve pageblocks for high-order atomic allocations on demand

From Vlastimil Babka <vbabka@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH 11/12] mm, page_alloc: Reserve pageblocks for high-order atomic allocations on demand
Date 2015-08-26 14:50 +0200
Message-ID <q1Ijo-602-21@gated-at.bofh.it> (permalink)
References <q0YTf-7q8-1@gated-at.bofh.it> <q0ZcD-7Np-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 08/24/2015 02:29 PM, Mel Gorman wrote:
> High-order watermark checking exists for two reasons --  kswapd high-order
> awareness and protection for high-order atomic requests. Historically the
> kernel depended on MIGRATE_RESERVE to preserve min_free_kbytes as high-order
> free pages for as long as possible. This patch introduces MIGRATE_HIGHATOMIC
> that reserves pageblocks for high-order atomic allocations on demand and
> avoids using those blocks for order-0 allocations. This is more flexible
> and reliable than MIGRATE_RESERVE was.
>
> A MIGRATE_HIGHORDER pageblock is created when a high-order allocation

                                                  ^ atomic ...

> request steals a pageblock but limits the total number to 1% of the zone.
> Callers that speculatively abuse atomic allocations for long-lived
> high-order allocations to access the reserve will quickly fail. Note that
> SLUB is currently not such an abuser as it reclaims at least once.  It is
> possible that the pageblock stolen has few suitable high-order pages and
> will need to steal again in the near future but there would need to be
> strong justification to search all pageblocks for an ideal candidate.
>
> The pageblocks are unreserved if an allocation fails after a direct
> reclaim attempt.
>
> The watermark checks account for the reserved pageblocks when the allocation
> request is not a high-order atomic allocation.
>
> The reserved pageblocks can not be used for order-0 allocations. This may
> allow temporary wastage until a failed reclaim reassigns the pageblock. This
> is deliberate as the intent of the reservation is to satisfy a limited
> number of atomic high-order short-lived requests if the system requires them.
>
> The stutter benchmark was used to evaluate this but while it was running
> there was a systemtap script that randomly allocated between 1 high-order
> page and 12.5% of memory's worth of order-3 pages using GFP_ATOMIC. This
> is much larger than the potential reserve and it does not attempt to be
> realistic.  It is intended to stress random high-order allocations from
> an unknown source, show that there is a reduction in failures without
> introducing an anomaly where atomic allocations are more reliable than
> regular allocations.  The amount of memory reserved varied throughout the
> workload as reserves were created and reclaimed under memory pressure. The
> allocation failures once the workload warmed up were as follows;
>
> 4.2-rc5-vanilla		70%
> 4.2-rc5-atomic-reserve	56%
>
> The failure rate was also measured while building multiple kernels. The
> failure rate was 14% but is 6% with this patch applied.
>
> Overall, this is a small reduction but the reserves are small relative to the
> number of allocation requests. In early versions of the patch, the failure
> rate reduced by a much larger amount but that required much larger reserves
> and perversely made atomic allocations seem more reliable than regular allocations.
>
> Signed-off-by: Mel Gorman <mgorman@techsingularity.net>

Acked-by: Vlastimil Babka <vbabka@suse.cz>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH 00/12] Remove zonelist cache and high-order watermark checking v3 Mel Gorman <mgorman@techsingularity.net> - 2015-08-24 14:20 +0200
  [PATCH 10/12] mm, page_alloc: Remove MIGRATE_RESERVE Mel Gorman <mgorman@techsingularity.net> - 2015-08-24 14:30 +0200
  [PATCH 11/12] mm, page_alloc: Reserve pageblocks for high-order  atomic allocations on demand Mel Gorman <mgorman@techsingularity.net> - 2015-08-24 14:40 +0200
    Re: [PATCH 11/12] mm, page_alloc: Reserve pageblocks for high-order  atomic allocations on demand Vlastimil Babka <vbabka@suse.cz> - 2015-08-26 14:50 +0200
    Re: [PATCH 11/12] mm, page_alloc: Reserve pageblocks for high-order  atomic allocations on demand Michal Hocko <mhocko@kernel.org> - 2015-08-26 17:00 +0200
      Re: [PATCH 11/12] mm, page_alloc: Reserve pageblocks for high-order  atomic allocations on demand Mel Gorman <mgorman@techsingularity.net> - 2015-08-26 17:40 +0200
  [PATCH 12/12] mm, page_alloc: Only enforce watermarks for order-0  allocations Mel Gorman <mgorman@techsingularity.net> - 2015-08-24 14:40 +0200
    Re: [PATCH 12/12] mm, page_alloc: Only enforce watermarks for order-0  allocations Vlastimil Babka <vbabka@suse.cz> - 2015-08-26 15:50 +0200
      Re: [PATCH 12/12] mm, page_alloc: Only enforce watermarks for  order-0 allocations Mel Gorman <mgorman@techsingularity.net> - 2015-08-26 17:00 +0200
    Re: [PATCH 12/12] mm, page_alloc: Only enforce watermarks for  order-0 allocations Michal Hocko <mhocko@kernel.org> - 2015-08-28 14:20 +0200
      Re: [PATCH 12/12] mm, page_alloc: Only enforce watermarks for  order-0 allocations Mel Gorman <mgorman@techsingularity.net> - 2015-08-28 16:20 +0200
  Re: [PATCH 07/12] mm, page_alloc: Distinguish between being unable  to sleep, unwilling to sleep and avoiding waking kswapd Mel Gorman <mgorman@techsingularity.net> - 2015-08-24 20:30 +0200
  Re: [PATCH 07/12] mm, page_alloc: Distinguish between being unable to  sleep, unwilling to sleep and avoiding waking kswapd Vlastimil Babka <vbabka@suse.cz> - 2015-08-25 17:40 +0200
    Re: [PATCH 07/12] mm, page_alloc: Distinguish between being unable  to sleep, unwilling to sleep and avoiding waking kswapd Mel Gorman <mgorman@techsingularity.net> - 2015-08-26 16:50 +0200
      Re: [PATCH 07/12] mm, page_alloc: Distinguish between being unable to  sleep, unwilling to sleep and avoiding waking kswapd Vlastimil Babka <vbabka@suse.cz> - 2015-08-26 18:30 +0200
        Re: [PATCH 07/12] mm, page_alloc: Distinguish between being unable  to sleep, unwilling to sleep and avoiding waking kswapd Mel Gorman <mgorman@techsingularity.net> - 2015-08-26 20:20 +0200
          Re: [PATCH 07/12] mm, page_alloc: Distinguish between being unable to  sleep, unwilling to sleep and avoiding waking kswapd Vlastimil Babka <vbabka@suse.cz> - 2015-08-27 11:20 +0200
  Re: [PATCH 07/12] mm, page_alloc: Distinguish between being unable to  sleep, unwilling to sleep and avoiding waking kswapd Vlastimil Babka <vbabka@suse.cz> - 2015-08-25 17:50 +0200

csiph-web