Skip to contentSkip to conversation

x86: spinlock ops are always-inlined

DISCUSSION Andrew Morton 2 participants 2 messages Apr 18, 2008 – Apr 21, 2008 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 20 lines · On Fri, 18 Apr 2008 18:47:21 GMT Linux Kernel Mailing List…
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7fda20f146d5d217684ffbc37c6b6c5f82c2dffd
Commit:     7fda20f146d5d217684ffbc37c6b6c5f82c2dffd
Parent:     d93c870bad38e8daaaf9f7e900a13431f24becbb
Author:     Ingo Molnar <[email protected]>
AuthorDate: Fri Feb 29 10:29:38 2008 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu Apr 17 17:41:29 2008 +0200

x86: spinlock ops are always-inlined

---
 include/asm-x86/spinlock.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
include/asm-x86/spinlock.h +0 -0
index 47dfe26..bc6376f 100644

include/asm-x86/spinlock.h static inline int __raw_spin_is_contended(raw_spinlock_t *lock) · line 81

Quoted 5 lines
include/asm-x86/spinlock.h +1 -1
@@ -78,7 +78,7 @@ static inline int __raw_spin_is_contended(raw_spinlock_t *lock)
 	return (((tmp >> 8) & 0xff) - (tmp & 0xff)) > 1;
 }
 
-static inline void __raw_spin_lock(raw_spinlock_t *lock)
+static __always_inline void __raw_spin_lock(raw_spinlock_t *lock)

What was the reason for making this change?

#2 lore raw
Quoted 26 lines · Andrew Morton
Quoted 23 lines · On Fri, 18 Apr 2008 18:47:21 GMT Linux Kernel Mailing List…
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7fda20f146d5d217684ffbc37c6b6c5f82c2dffd
Commit:     7fda20f146d5d217684ffbc37c6b6c5f82c2dffd
Parent:     d93c870bad38e8daaaf9f7e900a13431f24becbb
Author:     Ingo Molnar <[email protected]>
AuthorDate: Fri Feb 29 10:29:38 2008 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu Apr 17 17:41:29 2008 +0200

x86: spinlock ops are always-inlined

---
 include/asm-x86/spinlock.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
include/asm-x86/spinlock.h +0 -0
index 47dfe26..bc6376f 100644
@@ -78,7 +78,7 @@ static inline int __raw_spin_is_contended(raw_spinlock_t *lock)
 	return (((tmp >> 8) & 0xff) - (tmp & 0xff)) > 1;
 }
 
Quoted 4 lines

include/asm-x86/spinlock.h static inline int __raw_spin_is_contended(raw_spinlock_t *lock) · line 81

Quoted 2 lines
include/asm-x86/spinlock.h +1 -1
-static inline void __raw_spin_lock(raw_spinlock_t *lock)
+static __always_inline void __raw_spin_lock(raw_spinlock_t *lock)

What was the reason for making this change?

has no effect on current kernels (which always inline), but it breaks with an upcoming feature, CONFIG_OPTIMIZE_INLINING=y that lets gcc decide whether to inline or not. (should have mentioned this in the changelog, sorry)

Ingo