From: Dev Jain <dev.jain@arm.com>
To: Gavin Shan <gshan@redhat.com>, linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com,
will@kernel.org, anshuman.khandual@arm.com, ryan.roberts@arm.com,
peterx@redhat.com, joey.gouly@arm.com, yangyicong@hisilicon.com,
shan.gavin@gmail.com
Subject: Re: [PATCH] arm64: mm: Drop duplicate check in pmd_trans_huge()
Date: Thu, 8 May 2025 09:30:12 +0530 [thread overview]
Message-ID: <613ae7bd-b006-4f5a-8916-345001beb50f@arm.com> (raw)
In-Reply-To: <20250508035142.189726-1-gshan@redhat.com>
On 08/05/25 9:21 am, Gavin Shan wrote:
> pmd_val(pmd) is inclusive to pmd_present(pmd) since the PMD entry
> value isn't zero when pmd_present() returns true. Just drop the
> duplicate check done by pmd_val(pmd).
>
> No functional changes intended.
>
> Signed-off-by: Gavin Shan <gshan@redhat.com>
> ---
> Found this by code inspection
> ---
> arch/arm64/include/asm/pgtable.h | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
> index d3b538be1500..2599b9b8666f 100644
> --- a/arch/arm64/include/asm/pgtable.h
> +++ b/arch/arm64/include/asm/pgtable.h
> @@ -739,8 +739,7 @@ static inline int pmd_trans_huge(pmd_t pmd)
> * If pmd is present-invalid, pmd_table() won't detect it
> * as a table, so force the valid bit for the comparison.
> */
> - return pmd_val(pmd) && pmd_present(pmd) &&
> - !pmd_table(__pmd(pmd_val(pmd) | PTE_VALID));
> + return pmd_present(pmd) && !pmd_table(__pmd(pmd_val(pmd) | PTE_VALID));
> }
> #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
>
LGTM
Reviewed-by: Dev Jain <dev.jain@arm.com>
next prev parent reply other threads:[~2025-05-08 4:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-08 3:51 Gavin Shan
2025-05-08 4:00 ` Dev Jain [this message]
2025-05-08 5:44 ` Anshuman Khandual
2025-05-08 8:56 ` Gavin Shan
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=613ae7bd-b006-4f5a-8916-345001beb50f@arm.com \
--to=dev.jain@arm.com \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=gshan@redhat.com \
--cc=joey.gouly@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterx@redhat.com \
--cc=ryan.roberts@arm.com \
--cc=shan.gavin@gmail.com \
--cc=will@kernel.org \
--cc=yangyicong@hisilicon.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
all inboxes | Powered by JetHome®