Skip to content

Commit

Permalink
vmscan: check folio_test_private(), not folio_get_private()
Browse files Browse the repository at this point in the history
These two predicates are the same for file pages, but are not the same for
anonymous pages.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: 07f67a8 ("mm/vmscan: convert shrink_active_list() to use a folio")
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Reported-by: Hugh Dickins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Matthew Wilcox (Oracle) authored and akpm00 committed Sep 11, 2022
1 parent b9eb777 commit 36a3b14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 36a3b14

Please sign in to comment.