summaryrefslogtreecommitdiff
path: root/scripts/atomic/fallbacks/fetch_add_unless
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2019-11-26 15:04:05 +0100
committerPaul E. McKenney <paulmck@kernel.org>2020-01-07 07:47:23 -0800
commit944bc9cca7c392879fa2c3f911bbef7422707679 (patch)
tree2cface9e7cb16c595d2b4c758eb179f7d7360555 /scripts/atomic/fallbacks/fetch_add_unless
parentc020395b6634b7a674ee6aa91a971b08e268caba (diff)
downloadlwn-944bc9cca7c392879fa2c3f911bbef7422707679.tar.gz
lwn-944bc9cca7c392879fa2c3f911bbef7422707679.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) 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>
Diffstat (limited to 'scripts/atomic/fallbacks/fetch_add_unless')
-rwxr-xr-xscripts/atomic/fallbacks/fetch_add_unless2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/atomic/fallbacks/fetch_add_unless b/scripts/atomic/fallbacks/fetch_add_unless
index d2c091db7eae..fffbc0d16fdf 100755
--- a/scripts/atomic/fallbacks/fetch_add_unless
+++ b/scripts/atomic/fallbacks/fetch_add_unless
@@ -8,7 +8,7 @@ cat << EOF
* Atomically adds @a to @v, so long as @v was not already @u.
* Returns original value of @v
*/
-static inline ${int}
+static __always_inline ${int}
${atomic}_fetch_add_unless(${atomic}_t *v, ${int} a, ${int} u)
{
${int} c = ${atomic}_read(v);