Re: [PATCH] kernel/fork.c: get totalram_pages from memblock to calculate max_threads
From: Oleg Nesterov
Date: Sun Jun 30 2024 - 03:53:00 EST
On 06/30, Wei Yang wrote:
>
> static void set_max_threads(unsigned int max_threads_suggested)
> {
> u64 threads;
> - unsigned long nr_pages = totalram_pages();
> + unsigned long nr_pages = PHYS_PFN(memblock_phys_mem_size() - memblock_reserved_size());
Can't comment, I don't understand this patch.
but if you change set_max_threads, perhaps you can mark it as __init
for consistency?
Oleg.