Skip to content

Commit

Permalink
mm/damon/paddr: fix missing folio_sz update in damon_pa_young()
Browse files Browse the repository at this point in the history
The *folio_sz in damon_pa_young() will be used(as last_folio_sz) by
__damon_pa_check_access(), so it's need to be updated, fix missing branch.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Kefeng Wang <[email protected]>
Reviewed-by: SeongJae Park <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Kefeng Wang authored and akpm00 committed May 3, 2023
1 parent b6993be commit 70307b0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mm/damon/paddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ static bool damon_pa_young(unsigned long paddr, unsigned long *folio_sz)
}

need_lock = !folio_test_anon(folio) || folio_test_ksm(folio);
if (need_lock && !folio_trylock(folio)) {
folio_put(folio);
return false;
}
if (need_lock && !folio_trylock(folio))
goto out;

rmap_walk(folio, &rwc);

Expand Down

0 comments on commit 70307b0

Please sign in to comment.