mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: chengkaitao <pilgrimtao@gmail.com>
To: dave.hansen@linux.intel.com, luto@kernel.org,
	peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, x86@kernel.org, hpa@zytor.com
Cc: linux-kernel@vger.kernel.org, Chengkaitao <chengkaitao@kylinos.cn>
Subject: [PATCH] x86/mm: remove redundant computation of pmd_leaf
Date: Mon,  5 Jan 2026 19:51:51 +0800	[thread overview]
Message-ID: <20260105115152.86950-1-pilgrimtao@gmail.com> (raw)

From: Chengkaitao <chengkaitao@kylinos.cn>

In the function vmemmap_check_pmd, the result of pmd_leaf(*pmd) has
already been stored in the variable large. The subsequent code can
directly use this precomputed value instead of recalculating it.

Signed-off-by: Chengkaitao <chengkaitao@kylinos.cn>
---
 arch/x86/mm/init_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 9983017ecbe0..e361a81f7ccb 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1551,7 +1551,7 @@ int __meminit vmemmap_check_pmd(pmd_t *pmd, int node,
 {
 	int large = pmd_leaf(*pmd);
 
-	if (pmd_leaf(*pmd)) {
+	if (large) {
 		vmemmap_verify((pte_t *)pmd, node, addr, next);
 		vmemmap_use_sub_pmd(addr, next);
 	}
-- 
2.50.1 (Apple Git-155)


                 reply	other threads:[~2026-01-05 11:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260105115152.86950-1-pilgrimtao@gmail.com \
    --to=pilgrimtao@gmail.com \
    --cc=bp@alien8.de \
    --cc=chengkaitao@kylinos.cn \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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®