|
|
In SMP, all CPUs can access the same memory, and they all run the same copy of the kernel. As in the single processor version of the operating system, the operating system state on each CPU may be executing in kernel mode, executing in user mode, idle, or idle waiting for I/O.
All processors can run the kernel simultaneously because it is multithreaded; that is, it is designed to run simultaneously on several processors while protecting shared memory structures. Any processor can execute primary kernel functions such as filesystem access, memory and buffer management, distributed interrupt and trap handling, process scheduling, and system calls.
Most standard device drivers provided with the system are also multithreaded. Any unmodified driver or kernel module that does not register itself as multithreaded runs on the base processor.
``Process states on a multiprocessor computer'' shows how we can modify the process state diagram introduced in ``Process states'' and apply it to a multiprocessor system. Note that this diagram implies that the kernel not only has to consider when to run a process but also on which CPU to run it.
Process states on a multiprocessor computer