• Vlastimil Babka's avatar
    mm, compaction: raise compaction priority after it withdrawns · 49433085
    Vlastimil Babka authored
    Mike Kravetz reports that "hugetlb allocations could stall for minutes or
    hours when should_compact_retry() would return true more often then it
    should.  Specifically, this was in the case where compact_result was
    COMPACT_DEFERRED and COMPACT_PARTIAL_SKIPPED and no progress was being
    made."
    
    The problem is that the compaction_withdrawn() test in
    should_compact_retry() includes compaction outcomes that are only possible
    on low compaction priority, and results in a retry without increasing the
    priority.  This may result in furter reclaim, and more incomplete
    compaction attempts.
    
    With this patch, compaction priority is raised when possible, or
    should_compact_retry() returns false.
    
    The COMPACT_SKIPPED result doesn't really fit together with the other
    outcomes in compaction_withdrawn(), as that's a result caused by
    insufficient order-0 pages, not due to low compaction priority.  With this
    patch, it is moved to a new compaction_needs_reclaim() func...
    49433085
page_alloc.c 237 KB