From: Ingo Molnar yes, that one should probably be inlined too, it's just 1 byte longer, still the network-effects on register allocations give a net win: text data bss dec hex filename 4072031 858208 387196 5317435 51233b vmlinux-smp-uninlined 4060671 858212 387196 5306079 50f6df vmlinux-smp-inlined 4058543 858212 387196 5303951 50ee8f vmlinux-irqop-inlined-too another 0.05% drop in text size. Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton --- include/linux/spinlock.h | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff -puN include/linux/spinlock.h~x86-inline-spin_unlock_irq-if-not-config_debug_spinlock-and-not-config_preempt include/linux/spinlock.h --- devel/include/linux/spinlock.h~x86-inline-spin_unlock_irq-if-not-config_debug_spinlock-and-not-config_preempt 2005-10-20 16:38:11.000000000 -0700 +++ devel-akpm/include/linux/spinlock.h 2005-10-20 16:38:11.000000000 -0700 @@ -184,19 +184,29 @@ extern int __lockfunc generic__raw_read_ # define write_unlock(lock) __raw_write_unlock(&(lock)->raw_lock) #endif +#if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) +# define spin_unlock_irq(lock) _spin_unlock_irq(lock) +# define read_unlock_irq(lock) _read_unlock_irq(lock) +# define write_unlock_irq(lock) _write_unlock_irq(lock) +#else +# define spin_unlock_irq(lock) \ + do { __raw_spin_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) +# define read_unlock_irq(lock) \ + do { __raw_read_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) +# define write_unlock_irq(lock) \ + do { __raw_write_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) +#endif + #define spin_unlock_irqrestore(lock, flags) \ _spin_unlock_irqrestore(lock, flags) -#define spin_unlock_irq(lock) _spin_unlock_irq(lock) #define spin_unlock_bh(lock) _spin_unlock_bh(lock) #define read_unlock_irqrestore(lock, flags) \ _read_unlock_irqrestore(lock, flags) -#define read_unlock_irq(lock) _read_unlock_irq(lock) #define read_unlock_bh(lock) _read_unlock_bh(lock) #define write_unlock_irqrestore(lock, flags) \ _write_unlock_irqrestore(lock, flags) -#define write_unlock_irq(lock) _write_unlock_irq(lock) #define write_unlock_bh(lock) _write_unlock_bh(lock) #define spin_trylock_bh(lock) __cond_lock(_spin_trylock_bh(lock)) _