-   Linux - General (
-   -   How does the kernel handle multiple cpus/cores? (

riddler313 06-17-2009 02:20 PM

How does the kernel handle multiple cpus/cores?
I'm just wondering at how kernels traditionally handle SMP on multicore CPUs / multiple processor machines, that is does the kernel load a complete instance of itself per processor that schedules threads to run and use some sort of messaging between kernel instances to handle and fairly allocate resources and if so how do these instances interact with each other generally or is there only a single kernel instance present at all times?

syg00 06-18-2009 07:08 AM

There is only one kernel ... "to rule them all"
In fact the boot process starts on one processor (core), and activates the rest as part of startup. This is typical of general purpose operating systems.
The kernel will typically dispatch on the same processor continually - for cache coherency. These days there are "functions" within the kernel that run as separate threads and will dispatch on different processors.

Dinithion 06-18-2009 07:29 AM


Originally Posted by KERNEL

This allows you to specify the maximum number of CPUs which this
kernel will support. The maximum supported value is 512 and the
minimum value which makes sense is 2.

This is purely to save memory - each supported CPU adds
approximately eight kilobytes to the kernel image.

This is from "help" under Maximum numbers of CPUs in the kernel. Just a "nice to know". :)

syg00 06-18-2009 07:45 AM

Must be an old kernel - that was lifted to 4096 in 2.6.27

Dinithion 06-18-2009 08:35 AM

Hmm, I copied the text from 2.6.30, so I don't know. I haven't modified any files in there as far as I know :)

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