Skip to content

Commit 3f98c9a

Browse files
QQXanaduakpm00
authored andcommitted
mm/damon/paddr: fix missing folio_put()
damon_get_folio() would always increase folio _refcount and folio_isolate_lru() would increase folio _refcount if the folio's lru flag is set. If an unevictable folio isolated successfully, there will be two more _refcount. The one from folio_isolate_lru() will be decreased in folio_puback_lru(), but the other one from damon_get_folio() will be left behind. This causes a pin page. Whatever the case, the _refcount from damon_get_folio() should be decreased. Link: https://lkml.kernel.org/r/[email protected] Fixes: 57223ac ("mm/damon/paddr: support the pageout scheme") Signed-off-by: andrew.yang <[email protected]> Reviewed-by: SeongJae Park <[email protected]> Cc: <[email protected]> [5.16.x] Signed-off-by: Andrew Morton <[email protected]>
1 parent 4c67599 commit 3f98c9a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mm/damon/paddr.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,11 @@ static unsigned long damon_pa_pageout(struct damon_region *r, struct damos *s)
250250
folio_put(folio);
251251
continue;
252252
}
253-
if (folio_test_unevictable(folio)) {
253+
if (folio_test_unevictable(folio))
254254
folio_putback_lru(folio);
255-
} else {
255+
else
256256
list_add(&folio->lru, &folio_list);
257-
folio_put(folio);
258-
}
257+
folio_put(folio);
259258
}
260259
applied = reclaim_pages(&folio_list);
261260
cond_resched();

0 commit comments

Comments
 (0)