mm/mm_init.c: add new function calc_nr_all_pages()
authorBaoquan He <bhe@redhat.com>
Mon, 25 Mar 2024 14:56:43 +0000 (22:56 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Apr 2024 03:56:10 +0000 (20:56 -0700)
commit8ad4184985e844ab5848dbf8b7b02f4e14b5d010
tree8849e33b69befc395f2a913760b4c75ab71ba702
parent6600a6b10c3210280e7623b8ba7feac9619cc2cd
mm/mm_init.c: add new function calc_nr_all_pages()

This is a preparation to calculate nr_kernel_pages and nr_all_pages, both
of which will be used later in alloc_large_system_hash().

nr_all_pages counts up all free but not reserved memory in memblock
allocator, including HIGHMEM memory.  While nr_kernel_pages counts up all
free but not reserved low memory in memblock allocator, excluding HIGHMEM
memory.

Link: https://lkml.kernel.org/r/20240325145646.1044760-4-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>
mm/mm_init.c