Re: write_unlock: replace clear_bit with byte store

From: David Mosberger <davidm_at_napali.hpl.hp.com>
Date: 2005-04-29 06:43:14
>>>>> On Thu, 28 Apr 2005 13:32:35 -0700 (PDT), Christoph Lameter <clameter@engr.sgi.com> said:

  Christoph> #define _raw_write_unlock(x)								\
  Christoph> ({											\
  Christoph> -	smp_mb__before_clear_bit();	/* need barrier before releasing lock... */	\
  Christoph> -	clear_bit(31, (x));								\
  Christoph> +	u8 *y = (u8 *)x;								\
  Christoph> +	smp_wmb();			/* need barrier before releasing lock... */	\
  Christoph> +	y[3] = 0;									\
  Christoph> })

I'm unsure if it's a good idea to reduce the counter size.
Independent of that: using a name like "y" in a macro is bound to
cause name collisions so it's a big no-no.  Then why not declare
"y" as a "volatile u8 *" so you can avoid the explicit smp_wmb()?
This is ia64-specific code after all.

	--david

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Thu Apr 28 16:46:44 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:37 EST