• Mel Gorman's avatar
    mm, page_alloc: remove unnecessary parameter from zone_watermark_ok_safe · e2b19197
    Mel Gorman authored
    Overall, the intent of this series is to remove the zonelist cache which
    was introduced to avoid high overhead in the page allocator.  Once this is
    done, it is necessary to reduce the cost of watermark checks.
    
    The series starts with minor micro-optimisations.
    
    Next it notes that GFP flags that affect watermark checks are abused.
    __GFP_WAIT historically identified callers that could not sleep and could
    access reserves.  This was later abused to identify callers that simply
    prefer to avoid sleeping and have other options.  A patch distinguishes
    between atomic callers, high-priority callers and those that simply wish
    to avoid sleep.
    
    The zonelist cache has been around for a long time but it is of dubious
    merit with a lot of complexity and some issues that are explained.  The
    most important issue is that a failed THP allocation can cause a zone to
    be treated as "full".  This potentially causes unnecessary stalls, reclaim
    activity or remote fallbacks.  The issues could be fixed but it's not
    worth it.  The series places a small number of other micro-optimisations
    on top before examining GFP flags watermarks.
    
    High-order watermarks enforcement can cause high-order allocations to fail
    even though pages are free.  The watermark checks both protect high-order
    atomic allocations and make kswapd aware of high-order pages but there is
    a much better way that can be handled using migrate types.  This series
    uses page grouping by mobility to reserve pageblocks for high-order
    allocations with the size of the reservation depending on demand.  kswapd
    awareness is maintained by examining the free lists.  By patch 12 in this
    series, there are no high-order watermark checks while preserving the
    properties that motivated the introduction of the watermark checks.
    
    This patch (of 10):
    
    No user of zone_watermark_ok_safe() specifies alloc_flags.  This patch
    removes the unnecessary parameter.
    Signed-off-by: default avatarMel Gorman <mgorman@techsingularity.net>
    Acked-by: default avatarDavid Rientjes <rientjes@google.com>
    Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
    Acked-by: default avatarMichal Hocko <mhocko@suse.com>
    Reviewed-by: default avatarChristoph Lameter <cl@linux.com>
    Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    e2b19197
page_alloc.c 194 KB