[PATCH -v2 00/33] implement atomic_fetch_$op

From: Peter Zijlstra
Date: Tue May 31 2016 - 06:37:21 EST


As there have been a few requests for atomic_fetch_$op primitives and recently
by Linus, I figured I'd go and implement the lot.

The atomic_fetch_$op differs from the existing atomic_$op_return we already
have by returning the old value instead of the new value. This is especially
useful when the operation is irreversible (like bitops), and allows for things
like test-and-set.

This version incorporates all feedback from last time and is now complete thanks
to Will implementing ARMv8.1-LSE versions.

No known build breakage from the build-bot.

Notes:
- arc asm/atomic.h is a bit of a mess after the eznps merge, I would
recommend a restructure or split of that file, but could not find
the will to do it.
- arc, metag and tile could convert to _relaxed.

I'm aiming to merge this for v4.8 which should get this a fair few weeks in -next.