Skip to content

Commit 0910bf0

Browse files
RichardWeiYangrppt
authored andcommitted
kernel/fork.c: get estimated free pages by memblock api
Instead of getting estimated free pages from memblock directly, we have introduced an API, memblock_estimated_nr_free_pages(), which is more friendly for users. Just replace it with new API, no functional change. Signed-off-by: Wei Yang <richard.weiyang@gmail.com> CC: Mike Rapoport <rppt@kernel.org> CC: David Hildenbrand <david@redhat.com> CC: Oleg Nesterov <oleg@redhat.com> Acked-by: David Hildenbrand <david@redhat.com> Link: https://lore.kernel.org/r/20240808001415.6298-2-richard.weiyang@gmail.com Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
1 parent d0f8a89 commit 0910bf0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/fork.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ void __init __weak arch_task_cache_init(void) { }
997997
static void __init set_max_threads(unsigned int max_threads_suggested)
998998
{
999999
u64 threads;
1000-
unsigned long nr_pages = PHYS_PFN(memblock_phys_mem_size() - memblock_reserved_size());
1000+
unsigned long nr_pages = memblock_estimated_nr_free_pages();
10011001

10021002
/*
10031003
* The number of threads shall be limited such that the thread

0 commit comments

Comments
 (0)