Chris Metcalf wrote:
+static DEFINE_PER_CPU(bool, cpu_idling);
+
+/* Was the cpu was in the low-level idle code when interrupted? */
+bool in_cpu_idle(void)
+{
+ return this_cpu_read(cpu_idling);
I think we continue to need the code to identify a core that is running an interrupt handler. Interrupts are not masked at the point we set cpu_idling to false meaning we can easily be preempted before we clear the flag.