[PATCH 09/15] mm: move pgtable_init() to mm/mm_init.c and make it static

From: Mike Rapoport
Date: Sun Mar 19 2023 - 18:02:07 EST


From: "Mike Rapoport (IBM)" <rppt@xxxxxxxxxx>

pgtable_init() is only called from mm_core_init().

Move it close to the caller and make it static.

Signed-off-by: Mike Rapoport (IBM) <rppt@xxxxxxxxxx>
---
include/linux/mm.h | 6 ------
mm/mm_init.c | 6 ++++++
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 2d7f095136fc..c3c67d8bc833 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2782,12 +2782,6 @@ static inline bool ptlock_init(struct page *page) { return true; }
static inline void ptlock_free(struct page *page) {}
#endif /* USE_SPLIT_PTE_PTLOCKS */

-static inline void pgtable_init(void)
-{
- ptlock_cache_init();
- pgtable_cache_init();
-}
-
static inline bool pgtable_pte_page_ctor(struct page *page)
{
if (!ptlock_init(page))
diff --git a/mm/mm_init.c b/mm/mm_init.c
index 1da48762e4a2..a91fbb57c4cc 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -2511,6 +2511,12 @@ void __init memblock_free_pages(struct page *page, unsigned long pfn,
__free_pages_core(page, order);
}

+static void __init pgtable_init(void)
+{
+ ptlock_cache_init();
+ pgtable_cache_init();
+}
+
/* Report memory auto-initialization states for this boot. */
static void __init report_meminit(void)
{
--
2.35.1