mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kunwu Chan <kunwu.chan@gmail.com>
To: SJ Park <sj@kernel.org>
Cc: Kunwu Chan <kunwu.chan@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	damon@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH REPOST 4/5] mm/damon/vaddr: extend apply_probes() for hugetlb
Date: Fri, 11 Sep 2026 17:53:51 +0800	[thread overview]
Message-ID: <20260911095352.2803549-1-kunwu.chan@gmail.com> (raw)
In-Reply-To: <20260909140408.104699-5-sj@kernel.org>

On Wed,  9 Sep 2026 07:04:06 -0700 SJ Park <sj@kernel.org> wrote:

> 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
> 

Hi SJ,

Reviewed patches 1-4, with particular attention to the vaddr prep/apply flow, 
the filter handling shared with paddr, and the hugetlb page-walk path. 
The changes look consistent with the existing DAMON interfaces 
and page-walk semantics. 

Reviewed-by: Kunwu Chan <kunwu.chan@gmail.com> 

Thanks,
Kunwu

Sent using hkml (https://github.com/sjp38/hackermail)

  parent reply	other threads:[~2026-09-11  9:54 UTC|newest]

Thread overview: 20+ 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-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-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:04 ` [PATCH REPOST 4/5] mm/damon/vaddr: extend apply_probes() for hugetlb SJ Park
2026-09-11  2:00   ` Lian Wang
2026-09-11  9:53   ` Kunwu Chan [this message]
2026-09-09 14:04 ` [PATCH REPOST 5/5] mm/damon/vaddr: support pgidle_unset probe filter type SJ Park
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=20260911095352.2803549-1-kunwu.chan@gmail.com \
    --to=kunwu.chan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sj@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®