diff options
authorTobias Klauser <>2006-09-24 21:12:37 +0200
committerTobias Klauser <tklauser@xenon.tklauser.home>2006-09-24 21:12:37 +0200
commit7f077d511d1d211ac4718fa84d7f5245a00309da (patch)
parent264972b31f676c917da93c702f0205dc9d0dbcf9 (diff)
Add copyright information
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 817a77f..66f204f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
# Makefile for inotail
+# Copyright (C) 2006, Tobias Klauser <>
>1-15/+15 With both gcc 4.7.2 and 4.9.2, sometimes GCC mysteriously doesn't inline very small functions we expect to be inlined. See: In particular, with this config: there are more than a thousand copies of tiny spinlock-related functions: $ nm --size-sort vmlinux | grep -iF ' t ' | uniq -c | grep -v '^ *1 ' | sort -rn | grep ' spin' 473 000000000000000b t spin_unlock_irqrestore 292 000000000000000b t spin_unlock 215 000000000000000b t spin_lock 134 000000000000000b t spin_unlock_irq 130 000000000000000b t spin_unlock_bh 120 000000000000000b t spin_lock_irq 106 000000000000000b t spin_lock_bh Disassembly: ffffffff81004720 <spin_lock>: ffffffff81004720: 55 push %rbp ffffffff81004721: 48 89 e5 mov %rsp,%rbp ffffffff81004724: e8 f8 4e e2 02 callq <_raw_spin_lock> ffffffff81004729: 5d pop %rbp ffffffff8100472a: c3 retq This patch fixes this via s/inline/__always_inline/ in spinlock.h. This decreases vmlinux by about 40k: text data bss dec hex filename 82375570 22255544 20627456 125258570 7774b4a vmlinux.before 82335059 22255416 20627456 125217931 776ac8b vmlinux Signed-off-by: Denys Vlasenko <> Cc: Andrew Morton <> Cc: Andy Lutomirski <> Cc: Bart Van Assche <> Cc: Borislav Petkov <> Cc: Brian Gerst <> Cc: David Rientjes <> Cc: H. Peter Anvin <> Cc: Linus Torvalds <> Cc: Paul E. McKenney <> Cc: Peter Zijlstra <> Cc: Thomas Gleixner <> Cc: Thomas Graf <> Link: Signed-off-by: Ingo Molnar <> 2015-05-27documentation: memory-barriers: Fix smp_mb__before_spinlock() semanticsWill Deacon1-1/+1 Our current documentation claims that, when followed by an ACQUIRE, smp_mb__before_spinlock() orders prior loads against subsequent loads and stores, which isn't the intent. This commit therefore fixes the documentation to state that this sequence orders only prior stores against subsequent loads and stores. In addition, the original intent of smp_mb__before_spinlock() was to only order prior loads against subsequent stores, however, people have started using it as if it ordered prior loads against subsequent loads and stores. This commit therefore also updates smp_mb__before_spinlock()'s header comment to reflect this new reality. Cc: Oleg Nesterov <> Cc: "Paul E. McKenney" <> Cc: Peter Zijlstra <> Signed-off-by: Will Deacon <> Signed-off-by: Paul E. McKenney <> 2015-01-03spinlock: Add spin_lock_bh_nested()Thomas Graf1-0/+8 Signed-off-by: Thomas Graf <> Signed-off-by: David S. Miller <> 2014-08-13locking/spinlocks: Always evaluate the second argument of spin_lock_nested()Bart Van Assche1-1/+7 Evaluating a macro argument only if certain configuration options have been selected is confusing and error-prone. Hence always evaluate the second argument of spin_lock_nested(). An intentional side effect of this patch is that it avoids that the following warning is reported for netif_addr_lock_nested() when building with CONFIG_DEBUG_LOCK_ALLOC=n and with W=1: include/linux/netdevice.h: In function 'netif_addr_lock_nested': include/linux/netdevice.h:2865:6: warning: variable 'subclass' set but not used [-Wunused-but-set-variable] int subclass = SINGLE_DEPTH_NESTING; ^ Signed-off-by: Bart Van Assche <> Signed-off-by: Peter Zijlstra <> Cc: David Rientjes <> Cc: David S. Miller <> Cc: Andrew Morton <> Cc: Linus Torvalds <> Cc: Oleg Nesterov <> Cc: Paul E. McKenney <> Link: Signed-off-by: Ingo Molnar <> 2013-12-16locking: Add an smp_mb__after_unlock_lock() for UNLOCK+BLOCK barrierPaul E. McKenney1-0/+10 The Linux kernel has traditionally required that an UNLOCK+LOCK pair act as a full memory barrier when either (1) that UNLOCK+LOCK pair was executed by the same CPU or task, or (2) the same lock variable was used for the UNLOCK and LOCK. It now seems likely that very few places in the kernel rely on this full-memory-barrier semantic, and with the advent of queued locks, providing this semantic either requires complex reasoning, or for some architectures, added overhead. This commit therefore adds a smp_mb__after_unlock_lock(), which may be placed after a LOCK primitive to restore the full-memory-barrier semantic. All definitions are currently no-ops, but will be upgraded for some architectures when queued locks arrive. Signed-off-by: Paul E. McKenney <> Reviewed-by: Peter Zijlstra <> Cc: <> Cc: Linus Torvalds <> Cc: Andrew Morton <> Link: Signed-off-by: Ingo Molnar <> 2013-08-13sched: fix the theoretical signal_wake_up() vs schedule() raceOleg Nesterov1-3/+11 This is only theoretical, but after try_to_wake_up(p) was changed to check p->state under p->pi_lock the code like __set_current_state(TASK_INTERRUPTIBLE); schedule(); can miss a signal. This is the special case of wait-for-condition, it relies on try_to_wake_up/schedule interaction and thus it does not need mb() between __set_current_state() and if(signal_pending). However, this __set_current_state() can move into the critical section protected by rq->lock, now that try_to_wake_up() takes another lock we need to ensure that it can't be reordered with "if (signal_pending(current))" check inside that section. The patch is actually one-liner, it simply adds smp_wmb() before spin_lock_irq(rq->lock). This is what try_to_wake_up() already does by the same reason. We turn this wmb() into the new helper, smp_mb__before_spinlock(), for better documentation and to allow the architectures to change the default implementation. While at it, kill smp_mb__after_lock(), it has no callers. Perhaps we can also add smp_mb__before/after_spinunlock() for prepare_to_wait(). Signed-off-by: Oleg Nesterov <> Acked-by: Peter Zijlstra <> Signed-off-by: Linus Torvalds <> 2012-03-28Merge tag 'split-asm_system_h-for-linus-20120328' of ↵Linus Torvalds1-1/+1 git:// Pull "Disintegrate and delete asm/system.h" from David Howells: "Here are a bunch of patches to disintegrate asm/system.h into a set of separate bits to relieve the problem of circular inclusion dependencies. I've built all the working defconfigs from all the arches that I can and made sure that they don't break. The reason for these patches is that I recently encountered a circular dependency problem that came about when I produced some patches to optimise get_order() by rewriting it to use ilog2(). This uses bitops - and on the SH arch asm/bitops.h drags in asm-generic/get_order.h by a circuituous route involving asm/system.h. The main difficulty seems to be asm/system.h. It holds a number of low level bits with no/few dependencies that are commonly used (eg. memory barriers) and a number of bits with more dependencies that aren't used in many places (eg. switch_to()). These patches break asm/system.h up into the following core pieces: (1) asm/barrier.h Move memory barriers here. This already done for MIPS and Alpha. (2) asm/switch_to.h Move switch_to() and related stuff here. (3) asm/exec.h Move arch_align_stack() here. Other process execution related bits could perhaps go here from asm/processor.h. (4) asm/cmpxchg.h Move xchg() and cmpxchg() here as they're full word atomic ops and frequently used by atomic_xchg() and atomic_cmpxchg(). (5) asm/bug.h Move die() and related bits. (6) asm/auxvec.h Move AT_VECTOR_SIZE_ARCH here. Other arch headers are created as needed on a per-arch basis." Fixed up some conflicts from other header file cleanups and moving code around that has happened in the meantime, so David's testing is somewhat weakened by that. We'll find out anything that got broken and fix it.. * tag 'split-asm_system_h-for-linus-20120328' of git:// (38 commits) Delete all instances of asm/system.h Remove all #inclusions of asm/system.h Add #includes needed to permit the removal of asm/system.h Move all declarations of free_initmem() to linux/mm.h Disintegrate asm/system.h for OpenRISC Split arch_align_stack() out from asm-generic/system.h Split the switch_to() wrapper out of asm-generic/system.h Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h Create asm-generic/barrier.h Make asm-generic/cmpxchg.h #include asm-generic/cmpxchg-local.h Disintegrate asm/system.h for Xtensa Disintegrate asm/system.h for Unicore32 [based on ver #3, changed by gxt] Disintegrate asm/system.h for Tile Disintegrate asm/system.h for Sparc Disintegrate asm/system.h for SH Disintegrate asm/system.h for Score Disintegrate asm/system.h for S390 Disintegrate asm/system.h for PowerPC Disintegrate asm/system.h for PA-RISC Disintegrate asm/system.h for MN10300 ... 2012-03-28Remove all #inclusions of asm/system.hDavid Howells1-1/+0 Remove all #inclusions of asm/system.h preparatory to splitting and killing it. Performed with the following command: perl -p -i -e 's!^#\s*include\s*<asm/system[.]h>.*\n!!' `grep -Irl '^#\s*include\s*<asm/system[.]h>' *` Signed-off-by: David Howells <> 2012-03-28Add #includes needed to permit the removal of asm/system.hDavid Howells1-0/+1 asm/system.h is a cause of circular dependency problems because it contains commonly used primitive stuff like barrier definitions and uncommonly used stuff like switch_to() that might require MMU definitions. asm/system.h has been disintegrated by this point on all arches into the following common segments: (1) asm/barrier.h Moved memory barrier definitions here. (2) asm/cmpxchg.h Moved xchg() and cmpxchg() here. #included in asm/atomic.h. (3) asm/bug.h Moved die() and similar here. (4) asm/exec.h Moved arch_align_stack() here. (5) asm/elf.h Moved AT_VECTOR_SIZE_ARCH here. (6) asm/switch_to.h Moved switch_to() here. Signed-off-by: David Howells <> 2012-02-28spinlock: macroize assert_spin_locked to avoid bug.h dependencyPaul Gortmaker1-4/+1 In spinlock_api_smp.h we find a define for assert_raw_spin_locked [which uses BUG_ON]. Then assert_spin_locked (as an inline) uses it, meaning we need bug.h But rather than put linux/bug.h in such a highly used file like spinlock.h, we can just make the un-raw version also a macro. Then the required bug.h presence is limited just to those few files who are actually doing the assert testing. Signed-off-by: Paul Gortmaker <> CC: Thomas Gleixner <> 2011-07-26atomic: use <linux/atomic.h>Arun Sharma1-1/+1 This allows us to move duplicated code in <asm/atomic.h> (atomic_inc_not_zero() for now) to <linux/atomic.h> Signed-off-by: Arun Sharma <> Reviewed-by: Eric Dumazet <> Cc: Ingo Molnar <> Cc: David Miller <> Cc: Eric Dumazet <> Acked-by: Mike Frysinger <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <> 2011-03-31Fix common misspellingsLucas De Marchi1-1/+1 Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <> 2010-10-07Fix IRQ flag handling namingDavid Howells1-0/+1 Fix the IRQ flag handling naming. In linux/irqflags.h under one configuration, it maps: local_irq_enable() -> raw_local_irq_enable() local_irq_disable() -> raw_local_irq_disable() local_irq_save() -> raw_local_irq_save() ... and under the other configuration, it maps: raw_local_irq_enable() -> local_irq_enable() raw_local_irq_disable() -> local_irq_disable() raw_local_irq_save() -> local_irq_save() ... This is quite confusing. There should be one set of names expected of the arch, and this should be wrapped to give another set of names that are expected by users of this facility. Change this to have the arch provide: flags = arch_local_save_flags() flags = arch_local_irq_save() arch_local_irq_restore(flags) arch_local_irq_disable() arch_local_irq_enable() arch_irqs_disabled_flags(flags) arch_irqs_disabled() arch_safe_halt() Then linux/irqflags.h wraps these to provide: raw_local_save_flags(flags) raw_local_irq_save(flags) raw_local_irq_restore(flags) raw_local_irq_disable() raw_local_irq_enable() raw_irqs_disabled_flags(flags) raw_irqs_disabled() raw_safe_halt() with type checking on the flags 'arguments', and then wraps those to provide: local_save_flags(flags) local_irq_save(flags) local_irq_restore(flags) local_irq_disable() local_irq_enable() irqs_disabled_flags(flags) irqs_disabled() safe_halt() with tracing included if enabled. The arch functions can now all be inline functions rather than some of them having to be macros. Signed-off-by: David Howells <> [X86, FRV, MN10300] Signed-off-by: Chris Metcalf <> [Tile] Signed-off-by: Michal Simek <> [Microblaze] Tested-by: Catalin Marinas <> [ARM] Acked-by: Thomas Gleixner <> Acked-by: Haavard Skinnemoen <> [AVR] Acked-by: Tony Luck <> [IA-64] Acked-by: Hirokazu Takata <> [M32R] Acked-by: Greg Ungerer <> [M68K/M68KNOMMU] Acked-by: Ralf Baechle <> [MIPS] Acked-by: Kyle McMartin <> [PA-RISC] Acked-by: Paul Mackerras <> [PowerPC] Acked-by: Martin Schwidefsky <> [S390] Acked-by: Chen Liqin <> [Score] Acked-by: Matt Fleming <> [SH] Acked-by: David S. Miller <> [Sparc] Acked-by: Chris Zankel <> [Xtensa] Reviewed-by: Richard Henderson <> [Alpha] Reviewed-by: Yoshinori Sato <> [H8300] Cc: [CRIS] Cc: [CRIS] Cc: