• Barry Song's avatar
    mm: introduce arch_do_swap_page_nr() which allows restore metadata for nr pages · 29f252cd
    Barry Song authored
    Should do_swap_page() have the capability to directly map a large folio,
    metadata restoration becomes necessary for a specified number of pages
    denoted as nr.  It's important to highlight that metadata restoration is
    solely required by the SPARC platform, which, however, does not enable
    THP_SWAP.  Consequently, in the present kernel configuration, there exists
    no practical scenario where users necessitate the restoration of nr
    metadata.  Platforms implementing THP_SWAP might invoke this function with
    nr values exceeding 1, subsequent to do_swap_page() successfully mapping
    an entire large folio.  Nonetheless, their arch_do_swap_page_nr()
    functions remain empty.
    
    Link: https://lkml.kernel.org/r/20240529082824.150954-5-21cnbao@gmail.comSigned-off-by: default avatarBarry Song <v-songbaohua@oppo.com>
    Reviewed-by: default avatarRyan Roberts <ryan.roberts@arm.com>
    Reviewed-by: default avatarKhalid Aziz <khalid.aziz@oracle.com>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Andreas Larsson <andreas@gaisler.com>
    Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
    Cc: Chris Li <chrisl@kernel.org>
    Cc: Christoph Hellwig <hch@infradead.org>
    Cc: Chuanhua Han <hanchuanhua@oppo.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Gao Xiang <xiang@kernel.org>
    Cc: "Huang, Ying" <ying.huang@intel.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Kairui Song <kasong@tencent.com>
    Cc: Len Brown <len.brown@intel.com>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Cc: Pavel Machek <pavel@ucw.cz>
    Cc: "Rafael J. Wysocki" <rafael@kernel.org>
    Cc: Suren Baghdasaryan <surenb@google.com>
    Cc: Yosry Ahmed <yosryahmed@google.com>
    Cc: Yu Zhao <yuzhao@google.com>
    Cc: Zi Yan <ziy@nvidia.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    29f252cd
memory.c 179 KB