Linux Kernel startup takes a lot of time, which cannot be avoided. If you know linuxbios, you may know that linuxbios is faster than other bios, because it handed over the hardware detection task to the Linux kernel rather than the bios, after all, it is a waste of re-detection after the BIOS detects the kernel. For the sake of BIOS performance, is it irresponsible to push work to the kernel? Actually not. In fact, the most time-consuming operation during startup is hardware detection and initialization. It is precisely because of this that linuxbios has avoided such an arduous task and gave it to the operating system kernel.
Who can the kernel perform these tasks? It must be resolved by itself, because it is the foundation. To speed up the startup, the Linux designer handed over the hardware detection and initialization tasks to many kernel threads, when a kernel thread detects and initializes a Hardware Wait, it can detect and initialize another hardware, and perform parallel operations, which will be better on multiple CPU machines. According to the Linux tradition, everything is a process. At least you have to make the task a process. During kernel initialization, the kernel maintains two linked lists, one of which is the pending linked list, one is the running linked list. You don't need to worry about adding the hardware-related functions for pie initialization to the pending linked list. The powerful process scheduling mechanism of Linux will well process the execution of many hardware-initialized kernel threads, in addition, after the kernel Initialization is complete, the Mechanism interfaces of these kernel threads will be retained for a long time. Once tedious tasks require concurrent execution, they can still be completed using the kernel thread initialized by hardware detection, this mechanism is flexible.
What I don't know is, why can't we use a more unified work queue? Is the concurrency of the work queue poor?