[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240709023609.21332-3-richard.weiyang@gmail.com>
Date: Tue, 9 Jul 2024 02:36:09 +0000
From: Wei Yang <richard.weiyang@...il.com>
To: rppt@...nel.org,
akpm@...ux-foundation.org,
brauner@...nel.org,
oleg@...hat.com,
tandersen@...flix.com,
mjguzik@...il.com
Cc: linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Wei Yang <richard.weiyang@...il.com>
Subject: [PATCH v5 3/3] kernel/fork.c: put set_max_threads()/task_struct_whitelist() in __init section
Function set_max_threads()/task_struct_whitelist() is only used by
fork_init() during bootup.
Let's add __init tag to them.
Signed-off-by: Wei Yang <richard.weiyang@...il.com>
Suggested-by: Oleg Nesterov <oleg@...hat.com>
---
kernel/fork.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/fork.c b/kernel/fork.c
index d6c2a4ccd532..8d37c046dfeb 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -997,7 +997,7 @@ void __init __weak arch_task_cache_init(void) { }
/*
* set_max_threads
*/
-static void set_max_threads(unsigned int max_threads_suggested)
+static void __init set_max_threads(unsigned int max_threads_suggested)
{
u64 threads;
unsigned long nr_pages = memblock_estimated_nr_free_pages();
@@ -1023,7 +1023,7 @@ static void set_max_threads(unsigned int max_threads_suggested)
int arch_task_struct_size __read_mostly;
#endif
-static void task_struct_whitelist(unsigned long *offset, unsigned long *size)
+static void __init task_struct_whitelist(unsigned long *offset, unsigned long *size)
{
/* Fetch thread_struct whitelist for the architecture. */
arch_thread_struct_whitelist(offset, size);
--
2.34.1
Powered by blists - more mailing lists