diff options
author | Peter Zijlstra <peterz@infradead.org> | 2020-01-24 22:13:03 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2020-06-11 08:03:24 +0200 |
commit | 37f8173dd84936ea78000ed1cad24f8b18d48ebb (patch) | |
tree | 0b715066a7f5c16a71988e176627c46b61481b3c /scripts/atomic/fallbacks/sub_and_test | |
parent | 765dcd209947e7b3666c08fb109ab8b879f7a471 (diff) | |
download | linux-37f8173dd84936ea78000ed1cad24f8b18d48ebb.tar.gz linux-37f8173dd84936ea78000ed1cad24f8b18d48ebb.tar.bz2 linux-37f8173dd84936ea78000ed1cad24f8b18d48ebb.zip |
locking/atomics: Flip fallbacks and instrumentation
Currently instrumentation of atomic primitives is done at the architecture
level, while composites or fallbacks are provided at the generic level.
The result is that there are no uninstrumented variants of the
fallbacks. Since there is now need of such variants to isolate text poke
from any form of instrumentation invert this ordering.
Doing this means moving the instrumentation into the generic code as
well as having (for now) two variants of the fallbacks.
Notes:
- the various *cond_read* primitives are not proper fallbacks
and got moved into linux/atomic.c. No arch_ variants are
generated because the base primitives smp_cond_load*()
are instrumented.
- once all architectures are moved over to arch_atomic_ one of the
fallback variants can be removed and some 2300 lines reclaimed.
- atomic_{read,set}*() are no longer double-instrumented
Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lkml.kernel.org/r/20200505134058.769149955@linutronix.de
Diffstat (limited to 'scripts/atomic/fallbacks/sub_and_test')
-rwxr-xr-x | scripts/atomic/fallbacks/sub_and_test | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/atomic/fallbacks/sub_and_test b/scripts/atomic/fallbacks/sub_and_test index 6cfe4ed49746..c580f4c2136e 100755 --- a/scripts/atomic/fallbacks/sub_and_test +++ b/scripts/atomic/fallbacks/sub_and_test @@ -1,6 +1,6 @@ cat <<EOF /** - * ${atomic}_sub_and_test - subtract value from variable and test result + * ${arch}${atomic}_sub_and_test - subtract value from variable and test result * @i: integer value to subtract * @v: pointer of type ${atomic}_t * @@ -9,8 +9,8 @@ cat <<EOF * other cases. */ static __always_inline bool -${atomic}_sub_and_test(${int} i, ${atomic}_t *v) +${arch}${atomic}_sub_and_test(${int} i, ${atomic}_t *v) { - return ${atomic}_sub_return(i, v) == 0; + return ${arch}${atomic}_sub_return(i, v) == 0; } EOF |