Messages in this thread Patch in this message | | | Date | Fri, 3 Dec 2004 16:18:50 -0800 | From | Fenghua Yu <> | Subject | [PATCH] Add cpu_relax in idle spin loop for no-hlt kernel option |
| |
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(); } /* - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |