vmscan: check folio_test_private(), not folio_get_private()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 2 Sep 2022 19:26:39 +0000 (20:26 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 11 Sep 2022 23:22:31 +0000 (16:22 -0700)
These two predicates are the same for file pages, but are not the same for
anonymous pages.

Link: https://lkml.kernel.org/r/20220902192639.1737108-3-willy@infradead.org
Fixes: 87fd4436d810 ("mm/vmscan: convert shrink_active_list() to use a folio")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reported-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmscan.c

index b2b1431352dcd8ea791cef0a5fec25602a3b94a3..382dbe97329f33d052f0791787d7c054ad13b32d 100644 (file)
@@ -2550,8 +2550,8 @@ static void shrink_active_list(unsigned long nr_to_scan,
                }
 
                if (unlikely(buffer_heads_over_limit)) {
-                       if (folio_get_private(folio) && folio_trylock(folio)) {
-                               if (folio_get_private(folio))
+                       if (folio_test_private(folio) && folio_trylock(folio)) {
+                               if (folio_test_private(folio))
                                        filemap_release_folio(folio, 0);
                                folio_unlock(folio);
                        }