mm: call {ptlock,pgtable}_cache_init() directly from mm_core_init()
authorMike Rapoport (IBM) <rppt@kernel.org>
Tue, 21 Mar 2023 17:05:07 +0000 (19:05 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 6 Apr 2023 02:42:53 +0000 (19:42 -0700)
and drop pgtable_init() as it has no real value and its name is
misleading.

Link: https://lkml.kernel.org/r/20230321170513.2401534-9-rppt@kernel.org
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Doug Berger <opendmb@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Sergei Shtylyov <sergei.shtylyov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mm.h
mm/mm_init.c

index 6be179cec0813f3592e3a7abf0343d5c48ed7d92..dfff8bcaa766e456d0d572504d8050007e6246f3 100644 (file)
@@ -2637,12 +2637,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))
index bba73f1fb2772c8d046f1053eae2a1f3f6ac161e..f1475413394dc16f87cdf1167d7b5d04e43cbb85 100644 (file)
@@ -2584,7 +2584,8 @@ void __init mm_core_init(void)
         */
        page_ext_init_flatmem_late();
        kmemleak_init();
-       pgtable_init();
+       ptlock_cache_init();
+       pgtable_cache_init();
        debug_objects_mem_init();
        vmalloc_init();
        /* If no deferred init page_ext now, as vmap is fully initialized */