[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20260105115152.86950-1-pilgrimtao@gmail.com>
Date: Mon, 5 Jan 2026 19:51:51 +0800
From: chengkaitao <pilgrimtao@...il.com>
To: dave.hansen@...ux.intel.com,
luto@...nel.org,
peterz@...radead.org,
tglx@...utronix.de,
mingo@...hat.com,
bp@...en8.de,
x86@...nel.org,
hpa@...or.com
Cc: linux-kernel@...r.kernel.org,
Chengkaitao <chengkaitao@...inos.cn>
Subject: [PATCH] x86/mm: remove redundant computation of pmd_leaf
From: Chengkaitao <chengkaitao@...inos.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@...inos.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)
Powered by blists - more mailing lists