lab.nexedi.com will be down from Thursday, 20 March 2025, 07:30:00 UTC for a duration of approximately 2 hours

  • Chris Li's avatar
    mm: swap: mTHP allocate swap entries from nonfull list · d07a46a4
    Chris Li authored
    Track the nonfull cluster as well as the empty cluster on lists.  Each
    order has one nonfull cluster list.
    
    The cluster will remember which order it was used during new cluster
    allocation.
    
    When the cluster has free entry, add to the nonfull[order] list.   When
    the free cluster list is empty, also allocate from the nonempty list of
    that order.
    
    This improves the mTHP swap allocation success rate.
    
    There are limitations if the distribution of numbers of different orders
    of mTHP changes a lot.  e.g.  there are a lot of nonfull cluster assign to
    order A while later time there are a lot of order B allocation while very
    little allocation in order A.  Currently the cluster used by order A will
    not reused by order B unless the cluster is 100% empty.
    
    Link: https://lkml.kernel.org/r/20240730-swap-allocator-v5-2-cb9c148b9297@kernel.orgSigned-off-by: default avatarChris Li <chrisl@kernel.org>
    Reported-by: default avatarBarry Song <21cnbao@gmail.com>
    Cc: "Huang, Ying" <ying.huang@intel.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Kairui Song <kasong@tencent.com>
    Cc: Kalesh Singh <kaleshsingh@google.com>
    Cc: Ryan Roberts <ryan.roberts@arm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    d07a46a4
swapfile.c 94.2 KB