diff options
author | Wei Yang <richard.weiyang@gmail.com> | 2024-08-08 02:14:14 +0200 |
---|---|---|
committer | Mike Rapoport (Microsoft) <rppt@kernel.org> | 2024-08-11 18:19:00 +0200 |
commit | 0910bf0ef85c5404aac94394cb31e076e4eb03f1 (patch) | |
tree | 7e5198c845c915b35babab5d4bfa359a1082dd98 /kernel | |
parent | mm/memblock: introduce a new helper memblock_estimated_nr_free_pages() (diff) | |
download | linux-0910bf0ef85c5404aac94394cb31e076e4eb03f1.tar.xz linux-0910bf0ef85c5404aac94394cb31e076e4eb03f1.zip |
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/fork.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index cc760491f201..d99f148d818b 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -997,7 +997,7 @@ void __init __weak arch_task_cache_init(void) { } static void __init set_max_threads(unsigned int max_threads_suggested) { u64 threads; - unsigned long nr_pages = PHYS_PFN(memblock_phys_mem_size() - memblock_reserved_size()); + unsigned long nr_pages = memblock_estimated_nr_free_pages(); /* * The number of threads shall be limited such that the thread |