Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Thu, 7 Dec 2006, Nick Piggin wrote:
> 
> It might be reasonable to implement this watered down version, but:
> don't some architectures have restrictions on what instructions can
> be issued between the ll and the sc?

Yes. You really probably do not want to expose ll/sc on a C level because 
of this.

On alpha, the architecture manual says (I didn't go back and check, but 
I'm pretty sure) that a ld.l and st.c cannot have a taken branch in 
between then, for example. That basically means that you can't allow the 
compiler to reorder the basic blocks (which it often will with a 
while-loop).

Now, I actually suspect that this was not a microarchitectural flaw, and 
that a branch would _work_ there, and that the architecture manual was 
just being anal, but strictly speaking, it means that these things had 
better always be in assembly, and you can sadly not expose them (on alpha, 
at least) as higher-level primitives as such - you can only expose the 
end result ("cmpxchg" or similar).

		Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux