public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] 2.6.4 remove intermittent warnings from spinlock code
@ 2004-03-15  0:24 Keith Owens
  2004-03-16  7:34 ` David Mosberger
  2004-03-16 14:54 ` Matthew Wilcox
  0 siblings, 2 replies; 3+ messages in thread
From: Keith Owens @ 2004-03-15  0:24 UTC (permalink / raw)
  To: linux-ia64

The spinlock code writes to p14.  If gcc reuses p14 in the bundles
immediately after the spinlock then we get warning messages.  Append a
stop bit to the spinlock code to remove the warnings.  gcc 3.2.3,
binutils 2.14.90.0.4.

{standard input}: Assembler messages:
{standard input}:2217: Warning: Use of 'tbit.z' violates WAW dependency 'PR%, % in 1 - 15' (impliedf), specific resource number is 14
{standard input}:2217: Warning: Only the first path encountering the conflict is reported
{standard input}:2211: Warning: This is the location of the conflicting usage

Index: linux-2.6.4/include/asm-ia64/spinlock.h
--- linux-2.6.4.orig/include/asm-ia64/spinlock.h	Thu Mar 11 13:55:22 2004
+++ linux-2.6.4/include/asm-ia64/spinlock.h	Mon Mar 15 10:39:18 2004
@@ -52,6 +52,7 @@
 		      "cmp4.ne p14, p0 = r30, r0\n\t"
 		      "mov b6 = r29;;\n"
 		      "(p14) br.cond.spnt.many b6"
+		      ";;"
 		      : "=r"(ptr) : "r"(ptr) : IA64_SPINLOCK_CLOBBERS);
 # else
 	asm volatile ("{\n\t"
@@ -62,6 +63,7 @@
 		      "cmpxchg4.acq r30 = [%1], r30, ar.ccv;;\n\t"
 		      "cmp4.ne p14, p0 = r30, r0\n"
 		      "(p14) brl.cond.spnt.many ia64_spinlock_contention_pre3_4"
+		      ";;"
 		      : "=r"(ptr) : "r"(ptr) : IA64_SPINLOCK_CLOBBERS);
 # endif /* CONFIG_MCKINLEY */
 #else
@@ -75,6 +77,7 @@
 		      "cmp4.ne p14, p0 = r30, r0\n\t"
 		      "mov b6 = r29;;\n"
 		      "(p14) br.call.spnt.many b6 = b6"
+		      ";;"
 		      : "=r"(ptr) : "r"(ptr) : IA64_SPINLOCK_CLOBBERS);
 # else
 	asm volatile ("mov r30 = 1\n\t"
@@ -82,6 +85,7 @@
 		      "cmpxchg4.acq r30 = [%0], r30, ar.ccv;;\n\t"
 		      "cmp4.ne p14, p0 = r30, r0\n\t"
 		      "(p14) brl.call.spnt.many b6=ia64_spinlock_contention"
+		      ";;"
 		      : "=r"(ptr) : "r"(ptr) : IA64_SPINLOCK_CLOBBERS);
 # endif /* CONFIG_MCKINLEY */
 #endif


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] 2.6.4 remove intermittent warnings from spinlock code
  2004-03-15  0:24 [patch] 2.6.4 remove intermittent warnings from spinlock code Keith Owens
@ 2004-03-16  7:34 ` David Mosberger
  2004-03-16 14:54 ` Matthew Wilcox
  1 sibling, 0 replies; 3+ messages in thread
From: David Mosberger @ 2004-03-16  7:34 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Mon, 15 Mar 2004 11:24:36 +1100, Keith Owens <kaos@sgi.com> said:

  Keith> The spinlock code writes to p14.  If gcc reuses p14 in the
  Keith> bundles immediately after the spinlock then we get warning
  Keith> messages.  Append a stop bit to the spinlock code to remove
  Keith> the warnings.  gcc 3.2.3, binutils 2.14.90.0.4.

  Keith> {standard input}: Assembler messages: {standard input}:2217:
  Keith> Warning: Use of 'tbit.z' violates WAW dependency 'PR%, % in 1
  Keith> - 15' (impliedf), specific resource number is 14 {standard
  Keith> input}:2217: Warning: Only the first path encountering the
  Keith> conflict is reported {standard input}:2211: Warning: This is
  Keith> the location of the conflicting usage

Hmmh, in my opinion GCC should put a stop-bit when using a register
after an "asm" that marks that register as "clobbered".  For now, I
put an explicit stop-bit after the McKinley spinlock versions (the
Merced ones should be OK because they already have a stop-bit after
writing p14).  We should still sort out why GCC doesn't get this
right.

	--david

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] 2.6.4 remove intermittent warnings from spinlock code
  2004-03-15  0:24 [patch] 2.6.4 remove intermittent warnings from spinlock code Keith Owens
  2004-03-16  7:34 ` David Mosberger
@ 2004-03-16 14:54 ` Matthew Wilcox
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2004-03-16 14:54 UTC (permalink / raw)
  To: linux-ia64

On Mon, Mar 15, 2004 at 11:34:43PM -0800, David Mosberger wrote:
> Hmmh, in my opinion GCC should put a stop-bit when using a register
> after an "asm" that marks that register as "clobbered".  For now, I
> put an explicit stop-bit after the McKinley spinlock versions (the
> Merced ones should be OK because they already have a stop-bit after
> writing p14).  We should still sort out why GCC doesn't get this
> right.

I'm not a compiler person, but ...

Seems to me that doing exactly what you're asking for is hard.  Editing
the inline asm to use a stop-bit if the compiler needs to reuse that
register would be a really awful layering violation.  But it shouldn't
be too hard for p14 to be considered unavailable until the next stop
bit has been issued.

Al, want to raise this on the gcc mailing list?

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-03-16 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-15  0:24 [patch] 2.6.4 remove intermittent warnings from spinlock code Keith Owens
2004-03-16  7:34 ` David Mosberger
2004-03-16 14:54 ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox