All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fenghua Yu <fenghua.yu@intel.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] Add cpu_relax in idle spin loop for no-hlt kernel option
Date: Fri, 3 Dec 2004 16:18:50 -0800	[thread overview]
Message-ID: <20041203161850.A2133@unix-os.sc.intel.com> (raw)

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();
 }
 
 /*

                 reply	other threads:[~2004-12-04  0:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041203161850.A2133@unix-os.sc.intel.com \
    --to=fenghua.yu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.