Under Linux, what (if any) is the downside to disabling all interrupts on a particular CPU core, or even all cores on a single chip in a system containing multiple chips? When writing a C program that has extreme sensitivity to latency, my natural urge is to isolate the thread on its own core and move all other tasks to separate cores, and I'm wondering what the tradeoffs are.
The mainline Linux kernel is not designed to have all IRQs disabled on a CPU for an extended period. There are a number of internal kernel functions which require such IRQs - RCU being one of them. An RCU stall can and will bring down the rest of the system, and avoiding such a stall may (depending on the RCU implementation in use) involve IPIs (inter-processor interrupts) broadcasted to all CPUs.
That said, there are experimental patches to properly implement such CPU isolation; eg: http://lwn.net/Articles/268711/ - these go through all the internal gyrations needed to take a CPU offline (from the perspective of the rest of the kernel) before disabling interrupt routing. This is a fairly old patch series, though; you may want to contact the developer of the patch series to see if they have a newer version somewhere, or adapt those patches to the current version of the kernel. The PREEMPT_RT people are supposedly looking into implementing it as well - check out their wiki at https://rt.wiki.kernel.org/index.php/Main_Page (it's not implemented yet, though). Good luck!
A couple things to consider:
If you have complete trust that the process will give up control in a reasonable time and aren't worried about interrupt queueing, then it could be beneficial to disable interrupts.
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