From: SJ Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SJ Park <sj@kernel.org>,
damon@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: [PATCH REPOST 4/5] mm/damon/vaddr: extend apply_probes() for hugetlb
Date: Wed, 9 Sep 2026 07:04:06 -0700 [thread overview]
Message-ID: <20260909140408.104699-5-sj@kernel.org> (raw)
In-Reply-To: <20260909140408.104699-1-sj@kernel.org>
DAMON virtual address space operation set(vaddr) does not support
hugetlb pages in apply_probes. Extend it for hugetlb pages.
Signed-off-by: SJ Park <sj@kernel.org>
---
mm/damon/vaddr.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
index 7c548ec0cf6b5..45239f05e113b 100644
--- a/mm/damon/vaddr.c
+++ b/mm/damon/vaddr.c
@@ -598,6 +598,34 @@ static int damon_va_probe_pmd_entry(pmd_t *pmd, unsigned long addr,
return 0;
}
+#ifdef CONFIG_HUGETLB_PAGE
+static int damon_va_probe_hugetlb_entry(pte_t *pte, unsigned long hmask,
+ unsigned long addr, unsigned long end, struct mm_walk *walk)
+{
+ struct damon_va_probe_walk_private *priv = walk->private;
+ struct hstate *h = hstate_vma(walk->vma);
+ struct folio *folio;
+ spinlock_t *ptl;
+ pte_t entry;
+
+ ptl = huge_pte_lock(h, walk->mm, pte);
+ entry = huge_ptep_get(walk->mm, addr, pte);
+ if (!pte_present(entry))
+ goto out;
+
+ folio = pfn_folio(pte_pfn(entry));
+ folio_get(folio);
+ damon_va_probe_folio(priv->ctx, priv->r, folio);
+ folio_put(folio);
+
+out:
+ spin_unlock(ptl);
+ return 0;
+}
+#else
+#define damon_va_probe_hugetlb_entry NULL
+#endif /* CONFIG_HUGETLB_PAGE */
+
static void __damon_va_apply_probes(struct damon_ctx *ctx,
struct mm_struct *mm, struct damon_region *r)
{
@@ -607,7 +635,7 @@ static void __damon_va_apply_probes(struct damon_ctx *ctx,
};
struct mm_walk_ops damon_probe_walk_ops = {
.pmd_entry = damon_va_probe_pmd_entry,
- .hugetlb_entry = NULL,
+ .hugetlb_entry = damon_va_probe_hugetlb_entry,
};
unsigned long addr = r->sampling_addr;
--
2.47.3
next prev parent reply other threads:[~2026-09-09 14:04 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 14:04 [PATCH REPOST 0/5] mm/damon/vaddr: support {prep,apply}_probes SJ Park
2026-09-09 14:04 ` [PATCH REPOST 1/5] mm/damon/vaddr: support prep_probes SJ Park
2026-09-09 14:12 ` sashiko-bot
2026-09-11 1:59 ` Lian Wang
2026-09-09 14:04 ` [PATCH REPOST 2/5] mm/damon/paddr: move probe filter handling to ops-common SJ Park
2026-09-09 14:09 ` sashiko-bot
2026-09-11 2:00 ` Lian Wang
2026-09-09 14:04 ` [PATCH REPOST 3/5] mm/damon/vaddr: support apply_probe SJ Park
2026-09-09 14:11 ` sashiko-bot
2026-09-09 14:04 ` SJ Park [this message]
2026-09-09 14:11 ` [PATCH REPOST 4/5] mm/damon/vaddr: extend apply_probes() for hugetlb sashiko-bot
2026-09-11 2:00 ` Lian Wang
2026-09-11 9:53 ` Kunwu Chan
2026-09-09 14:04 ` [PATCH REPOST 5/5] mm/damon/vaddr: support pgidle_unset probe filter type SJ Park
2026-09-09 14:21 ` sashiko-bot
2026-09-11 2:01 ` Lian Wang
2026-09-11 13:33 ` SJ Park
2026-09-11 10:04 ` Kunwu Chan
2026-09-11 13:32 ` SJ Park
2026-09-11 15:32 ` KunWu Chan
2026-09-09 14:25 ` [PATCH REPOST 0/5] mm/damon/vaddr: support {prep,apply}_probes Gutierrez Asier
2026-09-09 14:31 ` SJ Park
2026-09-09 14:39 ` Gutierrez Asier
2026-09-09 14:43 ` SJ Park
2026-09-09 14:33 ` SJ Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260909140408.104699-5-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.