LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   SMP system - use a single CPU during boot (https://www.linuxquestions.org/questions/programming-9/smp-system-use-a-single-cpu-during-boot-677228/)

bromanescu 10-17-2008 08:18 PM

SMP system - use a single CPU during boot
 
I have an SMP system with 4 Pentium-4(i386) CPUs. I would like to restrict the kernel (2.6.15 Fedora Core) to use a single CPU during boot, but have the possibility to start using the other CPUs at a later time.

Using 'maxcpus=1' as a kernel option forces the boot on a single CPU, but totally disables the other cores (I can't use them anymore). I tried using the 'maxcpus' with the CPU hotplug, but once I have booted, I do not have the option to online the other cores.

Any advice would be extremely helpful. Thanks,

Bogdan

paulsm4 10-17-2008 10:09 PM

Hi -

Here's an excellent description of the boot process ... and why what you're asking for is nonsense:

http://duartes.org/gustavo/blog/post...l-boot-process

bromanescu 10-17-2008 10:55 PM

Quote:

Originally Posted by paulsm4 (Post 3314117)
Hi -

Here's an excellent description of the boot process ... and why what you're asking for is nonsense:

http://duartes.org/gustavo/blog/post...l-boot-process

Thanks for the link. However, it is unclear how the link you've provided renders my question useless. My issue is not that all the processors in the system are initialized (just a parenthesis, I'd be interested if there is a way to delay the initialization of certain processors; I'd think this is doable as there are NUMA systems that allow for hotplug CPUs), but that afterward, the kernel starts scheduling threads on all of them.

I'd like to either
  • restrict this scheduling of kernel threads to a single core (but be able to run user threads latter on all cores) OR
  • restrict the scheduling of any type of thread to a single core until I online the others

Thanks.

paulsm4 10-18-2008 12:50 PM

Hi -

The point I was trying to make was that:

a) Linux multiprocessing (like Windows, and *unlike* some other platforms), is a "Symmetric" multiprocessing model

b) Considerable work needs to be done before the processors can be brought on-line into multi-user mode (heck - considerable work needs to be done long before that, just bringing the x86 processor from real mode into protected mode)

c) In Linux, the last practical opportunity to do all this preparation - and also insure that all the CPUs are in synch with each other, and with the system as a whole - is just *before* the system starts the "init" process.

Perhaps another option might be "Processor Affinity":

http://www.ibm.com/developerworks/li...-affinity.html


IMHO .. PSM

PS:
I haven't tried this, but it also might help:
http://www.mjmwired.net/kernel/Docum...pu-hotplug.txt

syg00 10-18-2008 04:29 PM

And if you don't want to go playing with the processors themselves, have a look at cgroups.txt. For CPU isolation this works a treat - I have used its predecessor (cpusets) for ages to isolate my testing. That way I can log in using another CPU and monitor it successfully - and if/when it all goes to hell, I can still get in and kill it ... :p


All times are GMT -5. The time now is 04:50 AM.