Aug 14, 2016

The simple answer is that the kernel runs on all cores. But the answer is really that it depends which part of the kernel you are talking about.

Whenever user mode does a trap to supervisor mode it is running the top half of the kernel. An interrupt (device or timer) causes the core to run the bottom half of the kernel. Many systems used to only send these to cpu0, and it is typical that lots of network I/O would occur on cpu0.

In the PIII era, with a wide bus shared by all cores, most kernel data structures were not multithreaded, i.e. single run queue, great big kernel locks. There are now many per-core data structures, which can be in local memory. See http://www.tldp.org/LDP/tlk/kernel/kernel.html and for a recent discussion of scheduling: http://www.ece.ubc.ca/~sasha/papers/eurosys16-final29.pdf