Quantcast
Channel: lkml.org : Shesha Sreenivasamurthy
Viewing all articles
Browse latest Browse all 1267

Re: [tip:x86/fpu] bitops: Add clear/set_bit32() to linux/bitops.h

$
0
0
Linus Torvalds writes: (Summary) wrote:

[...]

behind the array.
Oh, it's much worse than that.
Oh, it's much worse than that.
It's not that it would write beyond the array on big-endian, even if it were to be _in_ the array it simply writes the wrong bit entirely. The alignment may be wrong, and even on architectures that handle unaligned loads and stores perfectly well, _atomic_ unaligned may not work at all.
unaligned may not work at all.
x86 is actually unique in handling even unaligned atomics, and even on x86 it's generally something you absolutely need to avoid for performance reasons (most of the time it's fine, but atomics that cross cachelines or pages can be very very expensive).

Viewing all articles
Browse latest Browse all 1267

Trending Articles