Linux s390 Architecture development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Anshuman Khandual" <anshuman.khandual@arm.com>
Cc: "Heiko Carstens" <hca@linux.ibm.com>,
	linux-s390@vger.kernel.org,
	"Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>
Subject: Re: [PATCH 3/3] parisc/mm: Drop all pxdp_get()
Date: Wed, 23 Sep 2026 04:42:38 +0000	[thread overview]
Message-ID: <20260923044238.6A18D1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260923043226.331880-4-anshuman.khandual@arm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] mm: unnecessary out-of-line conversion of ptep_test_and_clear_young()
--

commit 6892dae5d3895dcd59fc83328a1aca2f33ba942b
Author: Anshuman Khandual <anshuman.khandual@arm.com>

parisc/mm: Drop all pxdp_get()

This commit drops the redundant platform-specific pxdp_get() helpers in
favor of the generic MM header definitions. It also moves dependent functions
like ptep_test_and_clear_young() out-of-line to avoid build failures.

> diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
> index be3380c9bcdae..3da7d8def9435 100644
> --- a/arch/parisc/mm/init.c
> +++ b/arch/parisc/mm/init.c
> @@ -992,3 +992,16 @@ struct execmem_info __init *execmem_arch_setup(void)
>  	return &execmem_info;
>  }
>  #endif /* CONFIG_EXECMEM */
> +
> +bool ptep_test_and_clear_young(struct vm_area_struct *vma,
> +			       unsigned long addr, pte_t *ptep)
> +{
> +	pte_t pte;
> +
> +	pte = ptep_get(ptep);
> +	if (!pte_young(pte))
> +		return false;
> +
> +	set_pte_at(vma->vm_mm, addr, ptep, pte_mkold(pte));
> +	return true;
> +}

[Severity: Medium]
Is there a reason this function was moved out-of-line instead of dropping
the custom implementation entirely?

This implementation perfectly matches the generic inline default provided in
include/linux/pgtable.h. Since this path is called heavily during memory
pressure and page reclaim, such as from page_referenced_one(), moving it
out-of-line introduces function call overhead for every PTE scanned.

Could we instead remove the __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG definition
in arch/parisc/include/asm/pgtable.h? This would allow the compiler to use
the generic inline fallback and avoid the performance regression.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260923043226.331880-1-anshuman.khandual@arm.com?part=3

  reply	other threads:[~2026-09-23  4:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23  4:32 [PATCH 0/3] arch/mm: Drop similar platform overrides for pxdp_get() Anshuman Khandual
2026-09-23  4:32 ` [PATCH 1/3] s390/mm: Drop all pxdp_get() Anshuman Khandual
2026-09-23  4:42   ` sashiko-bot
2026-09-23  9:16   ` Heiko Carstens
2026-09-23 12:12     ` Anshuman Khandual
2026-09-23 14:32       ` Heiko Carstens
2026-09-24  2:37         ` Anshuman Khandual
2026-09-23  4:32 ` [PATCH 2/3] loongarch/mm: " Anshuman Khandual
2026-09-23  4:41   ` sashiko-bot
2026-09-23  4:32 ` [PATCH 3/3] parisc/mm: " Anshuman Khandual
2026-09-23  4:42   ` sashiko-bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-09-19 10:13 [PATCH 0/3] arch/mm: Drop similar platform overrides for pxdp_get() Anshuman Khandual
2026-09-19 10:13 ` [PATCH 3/3] parisc/mm: Drop all pxdp_get() Anshuman Khandual

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=20260923044238.6A18D1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=anshuman.khandual@arm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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