• Andrea Arcangeli's avatar
    mm: zone_reclaim: compaction: don't depend on kswapd to invoke reset_isolation_suitable · af24516e
    Andrea Arcangeli authored
    If kswapd never need to run (only __GFP_NO_KSWAPD allocations and
    plenty of free memory) compaction is otherwise crippled down and stops
    running for a while after the free/isolation cursor meets. After that
    allocation can fail for a full cycle of compaction_deferred, until
    compaction_restarting finally reset it again.
    
    Stopping compaction for a full cycle after the cursor meets, even if
    it never failed and it's not going to fail, doesn't make sense.
    
    We already throttle compaction CPU utilization using
    defer_compaction. We shouldn't prevent compaction to run after each
    pass completes when the cursor meets, unless it failed.
    
    This makes direct compaction functional again. The throttling of
    direct compaction is still controlled by the defer_compaction
    logic.
    
    kswapd still won't risk to reset compaction, and it will wait direct
    compaction to do so. Not sure if this is ideal but it at least
    decreases the risk of kswapd doing too much work. kswapd will only run
    one pass of compaction until some allocation invokes compaction again.
    
    This decreased reliability of compaction was introduced in commit
    62997027 .
    Signed-off-by: default avatarAndrea Arcangeli <aarcange@redhat.com>
    Reviewed-by: default avatarRik van Riel <riel@redhat.com>
    Acked-by: default avatarRafael Aquini <aquini@redhat.com>
    Acked-by: default avatarMel Gorman <mgorman@suse.de>
    af24516e
page_alloc.c 185 KB