lkml.org 
[lkml]   [2004]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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/
\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.045 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site