All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add cpu_relax in idle spin loop for no-hlt kernel option
@ 2004-12-04  0:18 Fenghua Yu
  0 siblings, 0 replies; only message in thread
From: Fenghua Yu @ 2004-12-04  0:18 UTC (permalink / raw)
  To: linux-kernel

If given no-hlt kernel option, ia32 idle loop turns out to be a spin loop.
Add cpu_relax() in this spin loop because IA32 SDM recommends that a PAUSE
instruction be put in all spin loops.

The patch is against 2.6.9 kernel.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>

diff -Nurp a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
--- a/arch/i386/kernel/process.c	2004-10-18 14:53:05.000000000 -0700
+++ b/arch/i386/kernel/process.c	2004-12-02 18:04:43.000000000 -0800
@@ -97,6 +97,8 @@ void default_idle(void)
 		else
 			local_irq_enable();
 	}
+	else
+		cpu_relax();
 }
 
 /*

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-12-04  0:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-04  0:18 [PATCH] Add cpu_relax in idle spin loop for no-hlt kernel option Fenghua Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.