@@ -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 */
@@ -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,
@@ -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)
{
@@ -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))
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(-)