linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: qinyu <qin.yuA@h3c.com>
Cc: SeongJae Park <sj@kernel.org>,
	damon@lists.linux.dev, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm/damon: remove redudnant mmu notifier call in pmdp mkold
Date: Tue,  3 Feb 2026 08:22:41 -0800	[thread overview]
Message-ID: <20260203162242.46851-1-sj@kernel.org> (raw)
In-Reply-To: <20260203095400.2465255-1-qin.yuA@h3c.com>

Hello qinyu,


I'd recommend to use "mm/damon/ops-common:" as the prefix of the commit
message.  Hopefully Andrew will make the modification when he adds this to the
mm tree.  For a case that Andrew might not since he must be busy for next merge
window, I will keep this patch in my tree with the subject change for a while
and repost if it is not picked up by Andrew for a while.  So you don't need to
repost this patch for the trivial change :)

On Tue, 3 Feb 2026 17:54:00 +0800 qinyu <qin.yuA@h3c.com> wrote:

> Currently, mmu_notifier_clear_young() is called immediately after
> pmdp_clear_young_notify(), which already calls mmu_notifier_clear_young()
> internally. This results in a redundant notifier call.
> 
> Replace pmdp_clear_young_notify() with the non-notify variant to avoid the
> duplicate call and make the pmdp path consistent with the corresponding
> ptep_mkold() code.

Nice catch, thank you!

> 
> Signed-off-by: qinyu <qin.yuA@h3c.com>

FWIW, Linux disallows anonymous contribution, and this tag should use a known
identity [1].  I was thinking about recommending to use real name, but I found
there are a few patches that using this identity (though email is different),
so looks fine to me.

    $ git log --author qinyu --oneline --pretty="%an <%ae>" linus/master
    Qinyun Tan <qinyuntan@linux.alibaba.com>
    qinyu <qinyu32@huawei.com>
    qinyu <qinyu32@huawei.com>
    qinyu <qinyu32@huawei.com>

[1] https://docs.kernel.org/process/submitting-patches.html#developer-s-certificate-of-origin-1-1

Reviewed-by: SeongJae Park <sj@kernel.org>

> ---
>  mm/damon/ops-common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/damon/ops-common.c b/mm/damon/ops-common.c
> index a218d9922..8c6d61342 100644
> --- a/mm/damon/ops-common.c
> +++ b/mm/damon/ops-common.c
> @@ -90,7 +90,7 @@ void damon_pmdp_mkold(pmd_t *pmd, struct vm_area_struct *vma, unsigned long addr
>  		return;
>  
>  	if (likely(pmd_present(pmdval)))
> -		young |= pmdp_clear_young_notify(vma, addr, pmd);
> +		young |= pmdp_test_and_clear_young(vma, addr, pmd);
>  	young |= mmu_notifier_clear_young(vma->vm_mm, addr, addr + HPAGE_PMD_SIZE);
>  	if (young)
>  		folio_set_young(folio);
> -- 
> 2.33.0


Thanks,
SJ

[...]


      reply	other threads:[~2026-02-03 16:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-03  9:54 qinyu
2026-02-03 16:22 ` SeongJae Park [this message]

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=20260203162242.46851-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-mm@kvack.org \
    --cc=qin.yuA@h3c.com \
    /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