Re: [patch] spinlocks: remove 'volatile'

From: Chuck Ebbert
Date: Fri Jul 07 2006 - 06:23:41 EST


In-Reply-To: <Pine.LNX.4.64.0607061333190.3869@xxxxxxxxxxx>

On Thu, 6 Jul 2006 13:34:14 -0700, Linus Torvalds wrote:

> > So I _think_ that we should change the "=m" to the much more correct "+m"
> > at the same time (or before - it's really a bug-fix regardless) as
> > removing the "volatile".
>
> Here's a first cut (UNTESTED!) for x86. I didn't check any other
> architectures, I bet they have similar problems.

> #define __raw_spin_unlock_string \
> "movb $1,%0" \
> - :"=m" (lock->slock) : : "memory"
> + :"+m" (lock->slock) : : "memory"

This really is just an overwrite of whatever is there. OTOH I can't see
how this change could hurt anything..

--
Chuck
"You can't read a newspaper if you can't read." --George W. Bush
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/