patch-2.3.48 linux/arch/i386/kernel/process.c

Next file: linux/arch/i386/kernel/semaphore.c
Previous file: linux/arch/i386/kernel/mtrr.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.47/linux/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
@@ -74,8 +74,13 @@
  */
 static void default_idle(void)
 {
-	if (current_cpu_data.hlt_works_ok && !hlt_counter)
-		asm volatile("sti ; hlt" : : : "memory");
+	if (current_cpu_data.hlt_works_ok && !hlt_counter) {
+		asm volatile("cli" : : : "memory");
+		if (!current->need_resched)
+			asm volatile("sti ; hlt" : : : "memory");
+		else
+			asm volatile("sti" : : : "memory");
+	}
 }
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)