summaryrefslogtreecommitdiffstats
path: root/mm/damon/paddr.c
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2023-03-08 16:33:11 +0800
committerAndrew Morton <akpm@linux-foundation.org>2023-05-02 17:21:49 -0700
commit70307b0e297a6634be855c49525ccbea50922a90 (patch)
treeec6bdb8376c90fe936a287e3cca4e5bae3de8e8e /mm/damon/paddr.c
parentb6993be23601c8bc992dc9743fbf78c1ff5d6b6a (diff)
downloadlinux-70307b0e297a6634be855c49525ccbea50922a90.tar.gz
linux-70307b0e297a6634be855c49525ccbea50922a90.tar.bz2
linux-70307b0e297a6634be855c49525ccbea50922a90.zip
mm/damon/paddr: fix missing folio_sz update in damon_pa_young()
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/20230308083311.120951-4-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Reviewed-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/damon/paddr.c')
-rw-r--r--mm/damon/paddr.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
index b22f6fbb5816..467b99166b43 100644
--- a/mm/damon/paddr.c
+++ b/mm/damon/paddr.c
@@ -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);