Commit dd52a61d authored by SeongJae Park's avatar SeongJae Park Committed by Andrew Morton

mm/damon/paddr: fix folio_nr_pages() after folio_put() in damon_pa_mark_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/20230304193949.296391-3-sj@kernel.org
Fixes: f70da5ee ("mm/damon: convert damon_pa_mark_accessed_or_deactivate() to use folios")
Signed-off-by: default avatarSeongJae Park <sj@kernel.org>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 751688b8
...@@ -280,8 +280,8 @@ static inline unsigned long damon_pa_mark_accessed_or_deactivate( ...@@ -280,8 +280,8 @@ static inline unsigned long damon_pa_mark_accessed_or_deactivate(
folio_mark_accessed(folio); folio_mark_accessed(folio);
else else
folio_deactivate(folio); folio_deactivate(folio);
folio_put(folio);
applied += folio_nr_pages(folio); applied += folio_nr_pages(folio);
folio_put(folio);
} }
return applied * PAGE_SIZE; return applied * PAGE_SIZE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment