diff mbox series

[RFC,1/3] mm: pgtable: move pte_free_defer() out of CONFIG_TRANSPARENT_HUGEPAGE

Message ID 7864fd8186075ae12fd227f13f4191f3d1bc6764.1718267194.git.zhengqi.arch@bytedance.com (mailing list archive)
State New
Headers show
Series asynchronously scan and free empty user PTE pages | expand

Commit Message

Qi Zheng June 13, 2024, 8:38 a.m. UTC
In order to reuse the pte_free_defer() in the subsequent work of freeing
empty user PTE pages, move it out of the CONFIG_TRANSPARENT_HUGEPAGE
range.

No functional change intended.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 arch/powerpc/mm/pgtable-frag.c | 2 --
 arch/s390/mm/pgalloc.c         | 2 --
 arch/sparc/mm/init_64.c        | 2 +-
 mm/pgtable-generic.c           | 2 +-
 4 files changed, 2 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/arch/powerpc/mm/pgtable-frag.c b/arch/powerpc/mm/pgtable-frag.c
index 8c31802f97e8..46d8f4bec85e 100644
--- a/arch/powerpc/mm/pgtable-frag.c
+++ b/arch/powerpc/mm/pgtable-frag.c
@@ -133,7 +133,6 @@  void pte_fragment_free(unsigned long *table, int kernel)
 	}
 }
 
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 void pte_free_defer(struct mm_struct *mm, pgtable_t pgtable)
 {
 	struct page *page;
@@ -142,4 +141,3 @@  void pte_free_defer(struct mm_struct *mm, pgtable_t pgtable)
 	SetPageActive(page);
 	pte_fragment_free((unsigned long *)pgtable, 0);
 }
-#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
diff --git a/arch/s390/mm/pgalloc.c b/arch/s390/mm/pgalloc.c
index abb629d7e131..6415379bd3fd 100644
--- a/arch/s390/mm/pgalloc.c
+++ b/arch/s390/mm/pgalloc.c
@@ -204,7 +204,6 @@  void __tlb_remove_table(void *table)
 	pagetable_pte_dtor_free(ptdesc);
 }
 
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 static void pte_free_now(struct rcu_head *head)
 {
 	struct ptdesc *ptdesc = container_of(head, struct ptdesc, pt_rcu_head);
@@ -223,7 +222,6 @@  void pte_free_defer(struct mm_struct *mm, pgtable_t pgtable)
 	 */
 	WARN_ON_ONCE(mm_has_pgste(mm));
 }
-#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
 /*
  * Base infrastructure required to generate basic asces, region, segment,
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 53d7cb5bbffe..20aaf123c9fc 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -2939,7 +2939,6 @@  void pgtable_free(void *table, bool is_page)
 		kmem_cache_free(pgtable_cache, table);
 }
 
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 static void pte_free_now(struct rcu_head *head)
 {
 	struct page *page;
@@ -2956,6 +2955,7 @@  void pte_free_defer(struct mm_struct *mm, pgtable_t pgtable)
 	call_rcu(&page->rcu_head, pte_free_now);
 }
 
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr,
 			  pmd_t *pmd)
 {
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index a78a4adf711a..197937495a0a 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -233,6 +233,7 @@  pmd_t pmdp_collapse_flush(struct vm_area_struct *vma, unsigned long address,
 	return pmd;
 }
 #endif
+#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
 /* arch define pte_free_defer in asm/pgalloc.h for its own implementation */
 #ifndef pte_free_defer
@@ -252,7 +253,6 @@  void pte_free_defer(struct mm_struct *mm, pgtable_t pgtable)
 	call_rcu(&page->rcu_head, pte_free_now);
 }
 #endif /* pte_free_defer */
-#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
 #if defined(CONFIG_GUP_GET_PXX_LOW_HIGH) && \
 	(defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RCU))