Linux:To speed up the startup process by setting some modules to start in parallel.

The SPACEMIT_PARALLEL_BOOTING option can be enabled for use, but it is disabled by default.

This feature is designed to optimize the boot speed for the SPACEMIT platform.
Although it can improve boot time, it may potentially cause deadlocks during startup.
It is recommended to set the loglevel to 1 when using this feature.

Change-Id: I3bd76816253277182b44c5e999e9b9db3b3f4beb
This commit is contained in:
goumin 2024-11-13 10:15:42 +08:00 committed by zhangmeng
parent 95a1c2f54f
commit 71c8fbc69b
13 changed files with 87 additions and 3 deletions

View file

@ -121,6 +121,9 @@
#include <net/compat.h>
#include <trace/events/sock.h>
#ifdef CONFIG_SPACEMIT_PARALLEL_BOOTING
#include <linux/async.h>
#endif
/* The inetsw table contains everything that inet_create needs to
* build a new socket.
@ -2080,7 +2083,21 @@ out_unregister_tcp_proto:
goto out;
}
#ifdef CONFIG_SPACEMIT_PARALLEL_BOOTING
static void __init inet_init_async(void *data, async_cookie_t cookie)
{
inet_init();
}
static int __init inet_async_init(void)
{
async_schedule(inet_init_async, NULL);
return 0;
}
subsys_initcall(inet_async_init);
#else
fs_initcall(inet_init);
#endif
/* ------------------------------------------------------------------------ */