Re: Fast 64-bit atomic writes (SSE?)

From: Andi Kleen
Date: Sat Mar 20 2004 - 02:40:01 EST


Roland Dreier <roland@xxxxxxxxxxxxxxxxxx> writes:
>
> General question:
> What's the best way to do this?

Definitely not how you do it ;-) You corrupt the user space FPU context.
Also you didn't do a CPUID check, so it would just crash on machines

The RAID code has some examples on how to use SSE2 in the kernel correctly.

Better is probably to use CMPXCHG8, which avoids all of this.

-Andi
-
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/