Skip to contentSkip to conversation

Move local_irq_enable() out of poll_idle()

PATCH New Jamie Lokier 1 participant 1 message Sep 6, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Move local_irq_enable() out of poll_idle()

Patch: irq_idle-2.6.0-test4-01jl

Scheduling is not allowed with interrupts disabled. So we know that when schedule() returns, local irqs are enabled. So poll_idle() doesn't need to enable them.

I suggest this change, to remove any confusion over whether the individual idle routines need to disable irqs themselves. (As seen recently in a thread about mwait_idle):

- remove the local_irq_enable() from poll_idle().

- add local_irq_enable() at the start of cpu_idle(), before the loop.

-- Jamie

arch/i386/kernel/process.c +2 -2
diff -urN --exclude-from=dontdiff orig-2.6.0-test4/arch/i386/kernel/process.c idle_irqs-2.6.0-test4/arch/i386/kernel/process.c
@@ -105,8 +105,6 @@
 {
 	int oldval;
 
-	local_irq_enable();
-
 	/*
 	 * Deal with another CPU just having chosen a thread to
 	 * run here:
@@ -136,6 +134,8 @@
  */
 void cpu_idle (void)
 {
+	local_irq_enable();
+
 	/* endless idle loop with no priority at all */
 	while (1) {
 		while (!need_resched()) {