Skip to content

Commit

Permalink
mm/damon/paddr: fix folio_nr_pages() after folio_put() in damon_pa_ma…
Browse files Browse the repository at this point in the history
…rk_accessed_or_deactivate()

damon_pa_mark_accessed_or_deactivate() is accessing a folio via
folio_nr_pages() after folio_put() for the folio has invoked.  Fix it.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: f70da5e ("mm/damon: convert damon_pa_mark_accessed_or_deactivate() to use folios")
Signed-off-by: SeongJae Park <[email protected]>
Reviewed-by: Kefeng Wang <[email protected]>
Reviewed-by: Matthew Wilcox (Oracle) <[email protected]>
Cc: Vishal Moola (Oracle) <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
sjp38 authored and akpm00 committed Mar 8, 2023
1 parent 751688b commit dd52a61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/damon/paddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ static inline unsigned long damon_pa_mark_accessed_or_deactivate(
folio_mark_accessed(folio);
else
folio_deactivate(folio);
folio_put(folio);
applied += folio_nr_pages(folio);
folio_put(folio);
}
return applied * PAGE_SIZE;
}
Expand Down

0 comments on commit dd52a61

Please sign in to comment.