summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2023-01-09 21:33:32 +0000
committerAndrew Morton <akpm@linux-foundation.org>2023-01-18 17:12:58 -0800
commit7477d7560cb2c756d6a8ab165d9ed52537df54e7 (patch)
tree1adad239176386ab88d28a55f7eea54282a16c46 /mm
parent18fd73dbe5c39707b51552d622235e5c41e3d869 (diff)
mm/damon/vaddr: record appropriate folio size when the access is not found
DAMON virtual address spaces monitoring operations set doesn't set folio size of the access checked address if access is not found. It could result in unnecessary and inefficient repeated check. Appropriately set the size regardless of access check result. Link: https://lkml.kernel.org/r/20230109213335.62525-4-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/damon/vaddr.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
index c7b192006fe6..1fec16d7263e 100644
--- a/mm/damon/vaddr.c
+++ b/mm/damon/vaddr.c
@@ -452,10 +452,9 @@ static int damon_young_pmd_entry(pmd_t *pmd, unsigned long addr,
goto huge_out;
if (pmd_young(*pmd) || !folio_test_idle(folio) ||
mmu_notifier_test_young(walk->mm,
- addr)) {
- *priv->folio_sz = HPAGE_PMD_SIZE;
+ addr))
priv->young = true;
- }
+ *priv->folio_sz = HPAGE_PMD_SIZE;
folio_put(folio);
huge_out:
spin_unlock(ptl);
@@ -474,10 +473,9 @@ regular_page:
if (!folio)
goto out;
if (pte_young(*pte) || !folio_test_idle(folio) ||
- mmu_notifier_test_young(walk->mm, addr)) {
- *priv->folio_sz = folio_size(folio);
+ mmu_notifier_test_young(walk->mm, addr))
priv->young = true;
- }
+ *priv->folio_sz = folio_size(folio);
folio_put(folio);
out:
pte_unmap_unlock(pte, ptl);
@@ -504,10 +502,9 @@ static int damon_young_hugetlb_entry(pte_t *pte, unsigned long hmask,
folio_get(folio);
if (pte_young(entry) || !folio_test_idle(folio) ||
- mmu_notifier_test_young(walk->mm, addr)) {
- *priv->folio_sz = huge_page_size(h);
+ mmu_notifier_test_young(walk->mm, addr))
priv->young = true;
- }
+ *priv->folio_sz = huge_page_size(h);
folio_put(folio);