LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Can i force the kernel to boot it's initializations parallel ??? (https://www.linuxquestions.org/questions/linux-kernel-70/can-i-force-the-kernel-to-boot-its-initializations-parallel-4175492003/)

embLinux 01-21-2014 05:50 AM

Can i force the kernel to boot it's initializations parallel ???
 
Hello,

I was wondering if i could mange to initialize drivers, services etc. (all these jobs what the kernel does during startup) in parallel instead of sequentially. I want to aggressively lower the boot time. I know some services depend on each other but to make an easy example: during probing the network devices, it shall take care of the audio too, instead of waiting 10 s until the network is ready.

I heard of systemd and InitNG but I'm sure there has to be other methods. Isn't there an option for the kernel itself to boot this way ?

Thanks and greets

syg00 01-21-2014 06:42 AM

The kernel neither knows nor cares about them - that's why you have an init task to initialize all that.

There are some functions you can build into the kernel, but certainly not all.

embLinux 01-21-2014 06:56 AM

I heared, that the kernel is doing many jobs already in parallel, but i thought it was possible to still improve this on some specific needs of the application. So the biggest part seems to be the init system ? Are there alternatives to systemd and InitNG ?

sundialsvcs 01-22-2014 09:24 AM

The init daemons usually execute a series of scripts in, say, /etc/init.d/, and it always executes them in alphabetical order.

You'll observe that the files (or symlinks) here include a number in their names: "Snn" for start scripts and "Knn" for kill scripts. This is done on purpose, specifically to allow you to re-order the scripts. ("Kill" scripts are executed in reverse alphabetical order.)

As far as I know, scripts are always executed one-by-one, for obvious reasons of simplicity. However, within a script, you might see things being executed in-parallel, say by using xargs with the -P maxprocs option. Which all makes sense ... "init" really doesn't know what each script actually does, so it executes whatever it finds, in an always predictable-sequence, and it allows each individual script to be the master of its own affairs. Scripts can potentially be written in any language or execute any program.

I would frankly advise you to "go ahead and wait 10 seconds," or to explicitly specify your network configuration (once Linux has figured out what it is by booting-up once), so that in the future it doesn't have to "probe" and "discover." Mucking around too much with this aspect of the system is likely to cause unpredictability = trouble, with no real payoff for your troubles.

embLinux 01-24-2014 01:04 AM

thanks for the response, even I knew most of what you said, still i prefere these wide answers, because if I find something new it helps to have better search results.

To have a fast boot, many people recommend to put all the init-scripts into just one, and if you say that it's possible to make it parallel within a script it all makes sense.

salasi 01-24-2014 03:22 AM

Quote:

Originally Posted by embLinux (Post 5102142)
Are there alternatives to systemd and InitNG ?

If you are saying that you are already using systemd, then, according to my limited knowledge, it should be already be capable of doing the things that you seem to be asking for.

So, maybe the answer is to look further into systemd, and see what it can do for you.


All times are GMT -5. The time now is 09:43 PM.