]> git.baikalelectronics.ru Git - kernel.git/commit
smp: don't use 16-bit words for atomic accesses
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 20 Apr 2015 16:08:49 +0000 (09:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 20 Apr 2015 16:08:49 +0000 (09:08 -0700)
commit20f239b9b7460dad81cd31ef8862d9aa2dbf5357
tree0ff1571b048f1e47efbb1d1042562f3a92b4f24e
parent16e4b7148a398ce562ae3abbbf533f907c8d0b0b
smp: don't use 16-bit words for atomic accesses

Yes, it should work, but it's a bad idea.  Not only did ARM64 not have
the 16-bit access code (there's a separate patch to add it), it's just
not a good atomic type.  Some architectures fundamentally don't do
atomic accesses in them (alpha), and it's not like it saves any space
here anyway because of structure packing issues.

We normally should aim for flags to be "unsigned int" or "unsigned
long".  And if space is at a premium, use a single byte (although that
causes problems on alpha again).  There might be very special cases
where a 16-byte entity is really wanted, but this is not one of them.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/smp.h