aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/atomic/fallbacks/inc_and_test
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2019-11-26 15:04:05 +0100
committerThomas Gleixner <tglx@linutronix.de>2020-06-11 08:03:24 +0200
commit765dcd209947e7b3666c08fb109ab8b879f7a471 (patch)
tree0dbe7fe72d9bd74804abfb90453138f8a6e997c1 /scripts/atomic/fallbacks/inc_and_test
parentMerge branch 'work.epoll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs (diff)
downloadlinux-dev-765dcd209947e7b3666c08fb109ab8b879f7a471.tar.xz
linux-dev-765dcd209947e7b3666c08fb109ab8b879f7a471.zip
asm-generic/atomic: Use __always_inline for fallback wrappers
Use __always_inline for atomic fallback wrappers. When building for size (CC_OPTIMIZE_FOR_SIZE), some compilers appear to be less inclined to inline even relatively small static inline functions that are assumed to be inlinable such as atomic ops. This can cause problems, for example in UACCESS regions. While the fallback wrappers aren't pure wrappers, they are trivial nonetheless, and the function they wrap should determine the final inlining policy. For x86 tinyconfig we observe: - vmlinux baseline: 1315988 - vmlinux with patch: 1315928 (-60 bytes) [ tglx: Cherry-picked from KCSAN ] Suggested-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Marco Elver <elver@google.com> Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'scripts/atomic/fallbacks/inc_and_test')
-rwxr-xr-xscripts/atomic/fallbacks/inc_and_test2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/atomic/fallbacks/inc_and_test b/scripts/atomic/fallbacks/inc_and_test
index 4e2068869f7e..4acea9c93604 100755
--- a/scripts/atomic/fallbacks/inc_and_test
+++ b/scripts/atomic/fallbacks/inc_and_test
@@ -7,7 +7,7 @@ cat <<EOF
* and returns true if the result is zero, or false for all
* other cases.
*/
-static inline bool
+static __always_inline bool
${atomic}_inc_and_test(${atomic}_t *v)
{
return ${atomic}_inc_return(v) == 0;