To give you full context, my discussion began with the observation that I am running SMP linux (3.0.1-rt11) on ARM cortex A8 based on SoC, which is single-processor. I was wondering if there would be any performance advantage by disabling SMP support. And if so, what impact will this have on my drivers and interrupt handlers.
I read something and came across two related topics: spinlocks and core preemption. I did a bit of search engine work and read, but this time all I have is a few outdated and conflicting answers. So I thought that let me try stackoverflow.
The origin of my doubts / questions is a couple of Linux device drivers 3rd edition, chapter 5:
Spinkins are inherently intended to be used on multiprocessor systems, although a single-processor workstation running on a proactive Kernel behaves like an SMP in relation to concurrency. If the unresponsive single-processor system has ever been locked, it will spin forever; no other thread can ever get the CPU to release the lock. For this reason, spin-lock operations on uniprocessor systems without prior activation are optimized to do nothing, except for those that change the IRQ masking. Because of the premise, even if you never expect your code to run on an SMP system, you still need to implement the correct lock.
My doubts / questions:
a) Is the Linux kernel a priority in the default kernel space? If so, is this limitation an advantage only for processes or interrupt handlers can also be preempted?
b) Does the Linux kernel (on ARM) support nested interrupt? If so, will each interrupt handler (upper half) have their own stack or will they use the same 4k / 8k kernel mode stack?
c) If you disable SMP (Config_SMP) and preemption (Config_preempt), will the locks in my drivers and interrupt handlers make any sense?
d) How do kernel descriptor interruptions occur when the upper half is executed ie will they be disabled or masked?
After some googling, I found this:
For kernels compiled without CONFIG_SMP and without CONFIG_PREEMPT, spin locks do not exist at all. This is a great design decision: when no one can work at the same time, there is no reason to block.
If the kernel is compiled without CONFIG_SMP, but CONFIG_PREEMPT set, then spinlocks simply disable preemption, which is enough to prevent any races. For most purposes, we can think of the equivalent of SMP, and not worry about it separately.
But there is no kernel version or date in the source. Can anyone confirm that it is still valid for the latest Linux kernels?