Skip to contentSkip to conversation

arm64/mm: don't initialize pgd_cache twice

PATCH In review Mike Rapoport 2 participants 2 messages Jun 18, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64/mm: don't initialize pgd_cache twice

When PGD_SIZE != PAGE_SIZE, arm64 uses kmem_cache for allocation of PGD memory. That cache was initialized twice: first through pgtable_cache_init() alias and then as an override for weak pgd_cache_init().

Remove the alias from pgtable_cache_init() and keep the only pgd_cache initialization in pgd_cache_init().

Fixes caa841360134 ("x86/mm: Initialize PGD cache during mm initialization")
---
 arch/arm64/include/asm/pgtable.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm64/include/asm/pgtable.h +1 -2
index 2c41b04..851c68d 100644
@@ -812,8 +812,7 @@ extern int kern_addr_valid(unsigned long addr);
 
 #include <asm-generic/pgtable.h>
 
-void pgd_cache_init(void);
-#define pgtable_cache_init	pgd_cache_init
+static inline void pgtable_cache_init(void) { }
 
 /*
  * On AArch64, the cache coherency is handled via the set_pte_at() function.
Signature · 1 line
2.7.4
#1 lore raw
Quoted 5 lines · Mike Rapoport

When PGD_SIZE != PAGE_SIZE, arm64 uses kmem_cache for allocation of PGD memory. That cache was initialized twice: first through pgtable_cache_init() alias and then as an override for weak pgd_cache_init().

Quoted 8 lines

Remove the alias from pgtable_cache_init() and keep the only pgd_cache initialization in pgd_cache_init().

Fixes caa841360134 ("x86/mm: Initialize PGD cache during mm initialization")
---
 arch/arm64/include/asm/pgtable.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Thanks, Mike.

Will