On my Ubuntu machine, default kernel image which is running is built for smp (CONFIG_SMP=y
). But this machine has only 1 cpu.
On uni-processor kernel, unlike smp kernel, spin_lock/unlock
are null functions.
So how does spin_lock()
and spin_unlock()
behave in this setup?
Is there any performance impact due to such smp specific code?
Current Linux kernels contain a patch that you can google for with the terms "SMP alternatives". In short, during boot, if the kernel detects that it's running on a uniprocessor machines, the spinlock functions are hot-patched with no-ops.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With