• Zi Yan's avatar
    mm/compaction: optimize >0 order folio compaction with free page split. · 73318e2c
    Zi Yan authored
    During migration in a memory compaction, free pages are placed in an array
    of page lists based on their order.  But the desired free page order
    (i.e., the order of a source page) might not be always present, thus
    leading to migration failures and premature compaction termination.  Split
    a high order free pages when source migration page has a lower order to
    increase migration successful rate.
    
    Note: merging free pages when a migration fails and a lower order free
    page is returned via compaction_free() is possible, but there is too much
    work.  Since the free pages are not buddy pages, it is hard to identify
    these free pages using existing PFN-based page merging algorithm.
    
    Link: https://lkml.kernel.org/r/20240220183220.1451315-5-zi.yan@sent.comSigned-off-by: default avatarZi Yan <ziy@nvidia.com>
    Reviewed-by: default avatarBaolin Wang <baolin.wang@linux.alibaba.com>
    Reviewed-by: default avatarVlastimil Babka <vbabka@suse.cz>
    Tested-by: default avatarBaolin Wang <baolin.wang@linux.alibaba.com>
    Tested-by: default avatarYu Zhao <yuzhao@google.com>
    Cc: Adam Manzanares <a.manzanares@samsung.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Huang Ying <ying.huang@intel.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Kemeng Shi <shikemeng@huaweicloud.com>
    Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
    Cc: Luis Chamberlain <mcgrof@kernel.org>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Cc: Mel Gorman <mgorman@techsingularity.net>
    Cc: Ryan Roberts <ryan.roberts@arm.com>
    Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Cc: Yin Fengwei <fengwei.yin@intel.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    73318e2c
compaction.c 92.8 KB