]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm-swap-allow-cache-reclaim-to-skip-slot-cache-fix
authorBarry Song <21cnbao@gmail.com>
Mon, 5 Aug 2024 01:53:24 +0000 (13:53 +1200)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 17 Aug 2024 00:52:46 +0000 (17:52 -0700)
small folios should have nr_pages == 1 but not nr_page == 0

Link: https://lkml.kernel.org/r/20240805015324.45134-1-21cnbao@gmail.com
Signed-off-by: Barry Song <21cnbao@gmail.com>
Cc: Chris Li <chrisl@kernel.org>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Kairui Song <ryncsn@gmail.com>
Cc: Kalesh Singh <kaleshsingh@google.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/swapfile.c

index 91e7e992941c01fbe860aa368b6e1c90c9915d9f..e4c797af9586cb59e48cda0636bb4217b0268d77 100644 (file)
@@ -224,7 +224,7 @@ static int __try_to_reclaim_swap(struct swap_info_struct *si,
 
        spin_lock(&si->lock);
        /* Only sinple page folio can be backed by zswap */
-       if (!nr_pages)
+       if (nr_pages == 1)
                zswap_invalidate(entry);
        swap_entry_range_free(si, entry, nr_pages);
        spin_unlock(&si->lock);