]> Git Repo - linux.git/commitdiff
kernel/fork.c: get estimated free pages by memblock api
authorWei Yang <[email protected]>
Thu, 8 Aug 2024 00:14:14 +0000 (00:14 +0000)
committerMike Rapoport (Microsoft) <[email protected]>
Sun, 11 Aug 2024 16:19:00 +0000 (19:19 +0300)
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 <[email protected]>
CC: Mike Rapoport <[email protected]>
CC: David Hildenbrand <[email protected]>
CC: Oleg Nesterov <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mike Rapoport (Microsoft) <[email protected]>
kernel/fork.c

index cc760491f20127f44ab5db96ec7e858dcce77f54..d99f148d818b63e90805348daf0f482f247751bb 100644 (file)
@@ -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
This page took 0.07935 seconds and 4 git commands to generate.