* [PATCH] x86/mm: remove redundant computation of pmd_leaf
@ 2026-01-05 11:51 chengkaitao
0 siblings, 0 replies; only message in thread
From: chengkaitao @ 2026-01-05 11:51 UTC (permalink / raw)
To: dave.hansen, luto, peterz, tglx, mingo, bp, x86, hpa
Cc: linux-kernel, Chengkaitao
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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-05 11:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-05 11:51 [PATCH] x86/mm: remove redundant computation of pmd_leaf chengkaitao
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®