]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/mm_init.c: remove arch_reserved_kernel_pages()
authorBaoquan He <bhe@redhat.com>
Mon, 25 Mar 2024 14:56:46 +0000 (22:56 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Apr 2024 03:56:11 +0000 (20:56 -0700)
Since the current calculation of calc_nr_kernel_pages() has taken into
consideration of kernel reserved memory, no need to have
arch_reserved_kernel_pages() any more.

Link: https://lkml.kernel.org/r/20240325145646.1044760-7-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/powerpc/include/asm/mmu.h
arch/powerpc/kernel/fadump.c
include/linux/mm.h
mm/mm_init.c

index 3b72c7ed24cfdeec454af137d99d01c7f718f044..aa5c0fd5edb1c9f36c25fe65fe956b1e308c8588 100644 (file)
@@ -406,9 +406,5 @@ extern void *abatron_pteptrs[2];
 #include <asm/nohash/mmu.h>
 #endif
 
-#if defined(CONFIG_FA_DUMP) || defined(CONFIG_PRESERVE_FA_DUMP)
-#define __HAVE_ARCH_RESERVED_KERNEL_PAGES
-#endif
-
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_MMU_H_ */
index d14eda1e85896807bdabb61987e4b21f3ee949ea..ae8c7619e597d95ea2a161e204ab8765b8295938 100644 (file)
@@ -1735,8 +1735,3 @@ static void __init fadump_reserve_crash_area(u64 base)
                memblock_reserve(mstart, msize);
        }
 }
-
-unsigned long __init arch_reserved_kernel_pages(void)
-{
-       return memblock_reserved_size() / PAGE_SIZE;
-}
index 22ae6ab621da265890832513efdad44571b0e267..dd47ba7a1c041f0327f86ee18e6aea55348e0b35 100644 (file)
@@ -3261,9 +3261,6 @@ static inline void show_mem(void)
 extern long si_mem_available(void);
 extern void si_meminfo(struct sysinfo * val);
 extern void si_meminfo_node(struct sysinfo *val, int nid);
-#ifdef __HAVE_ARCH_RESERVED_KERNEL_PAGES
-extern unsigned long arch_reserved_kernel_pages(void);
-#endif
 
 extern __printf(3, 4)
 void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...);
index 8c261572ca6ea4e225dc0f60c391f64b2518e325..0d32bcc301e232f47f81a60b919402ea917505b6 100644 (file)
@@ -2374,17 +2374,6 @@ void __init page_alloc_init_late(void)
        page_alloc_sysctl_init();
 }
 
-#ifndef __HAVE_ARCH_RESERVED_KERNEL_PAGES
-/*
- * Returns the number of pages that arch has reserved but
- * is not known to alloc_large_system_hash().
- */
-static unsigned long __init arch_reserved_kernel_pages(void)
-{
-       return 0;
-}
-#endif
-
 /*
  * Adaptive scale is meant to reduce sizes of hash tables on large memory
  * machines. As memory size is increased the scale is also increased but at
@@ -2427,7 +2416,6 @@ void *__init alloc_large_system_hash(const char *tablename,
        if (!numentries) {
                /* round applicable memory size up to nearest megabyte */
                numentries = nr_kernel_pages;
-               numentries -= arch_reserved_kernel_pages();
 
                /* It isn't necessary when PAGE_SIZE >= 1MB */
                if (PAGE_SIZE < SZ_1M)