public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Fenghua Yu <fenghua.yu@intel.com>
To: linux-ia64@vger.kernel.org
Subject: [PATCH] add cpu_relax() in spin loops
Date: Wed, 10 Nov 2004 03:35:26 +0000	[thread overview]
Message-ID: <20041109193526.A4895@unix-os.sc.intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 222 bytes --]

This patch adds cpu_relax() in the body of spin loops in
smp_call_function(), smp_call_function_single(), and
ia64_mca_wakeup_ipi_wait().

The patch is against the latest linux-ia64-test-2.6.10
bk tree.

Thanks.

-Fenghua

[-- Attachment #2: spin_loops_ia64.patch --]
[-- Type: text/plain, Size: 1049 bytes --]

--- a/arch/ia64/kernel/mca.c	2004-10-26 11:52:44.000000000 -0700
+++ b/arch/ia64/kernel/mca.c	2004-10-28 14:07:12.000000000 -0700
@@ -686,6 +686,7 @@ ia64_mca_wakeup_ipi_wait(void)
 			irr = ia64_getreg(_IA64_REG_CR_IRR3);
 			break;
 		}
+		cpu_relax();
 	} while (!(irr & (1UL << irr_bit))) ;
 }
 
--- a/arch/ia64/kernel/smp.c	2004-10-26 11:52:44.000000000 -0700
+++ b/arch/ia64/kernel/smp.c	2004-10-28 14:08:21.000000000 -0700
@@ -290,11 +290,11 @@ smp_call_function_single (int cpuid, voi
 
 	/* Wait for response */
 	while (atomic_read(&data.started) != cpus)
-		barrier();
+		cpu_relax();
 
 	if (wait)
 		while (atomic_read(&data.finished) != cpus)
-			barrier();
+			cpu_relax();
 	call_data = NULL;
 
 	spin_unlock_bh(&call_lock);
@@ -349,11 +349,11 @@ smp_call_function (void (*func) (void *i
 
 	/* Wait for response */
 	while (atomic_read(&data.started) != cpus)
-		barrier();
+		cpu_relax();
 
 	if (wait)
 		while (atomic_read(&data.finished) != cpus)
-			barrier();
+			cpu_relax();
 	call_data = NULL;
 
 	spin_unlock(&call_lock);

                 reply	other threads:[~2004-11-10  3:35 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=20041109193526.A4895@unix-os.sc.intel.com \
    --to=fenghua.yu@intel.com \
    --cc=linux-ia64@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox