aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavidlohr Bueso <davidlohr@hp.com>2014-07-30 16:41:55 -0400
committerIngo Molnar <mingo@kernel.org>2014-08-13 04:32:03 -0400
commit214e0aed639ef40987bf6159fad303171a6de31e (patch)
tree9f4c2eb1497a7377de93d619c05cf6c82fcfa0cb
parent7608a43d8f2e02f8b532f8e11481d7ecf8b5d3f9 (diff)
locking/Documentation: Move locking related docs into Documentation/locking/
Specifically: Documentation/locking/lockdep-design.txt Documentation/locking/lockstat.txt Documentation/locking/mutex-design.txt Documentation/locking/rt-mutex-design.txt Documentation/locking/rt-mutex.txt Documentation/locking/spinlocks.txt Documentation/locking/ww-mutex-design.txt Signed-off-by: Davidlohr Bueso <davidlohr@hp.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: jason.low2@hp.com Cc: aswin@hp.com Cc: Alexei Starovoitov <ast@plumgrid.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Chris Mason <clm@fb.com> Cc: Dan Streetman <ddstreet@ieee.org> Cc: David Airlie <airlied@linux.ie> Cc: Davidlohr Bueso <davidlohr@hp.com> Cc: David S. Miller <davem@davemloft.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Jason Low <jason.low2@hp.com> Cc: Josef Bacik <jbacik@fusionio.com> Cc: Kees Cook <keescook@chromium.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Lubomir Rintel <lkundrak@v3.sk> Cc: Masanari Iida <standby24x7@gmail.com> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Tim Chen <tim.c.chen@linux.intel.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: fengguang.wu@intel.com Link: http://lkml.kernel.org/r/1406752916-3341-6-git-send-email-davidlohr@hp.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--Documentation/00-INDEX2
-rw-r--r--Documentation/DocBook/kernel-locking.tmpl2
-rw-r--r--Documentation/locking/lockdep-design.txt (renamed from Documentation/lockdep-design.txt)0
-rw-r--r--Documentation/locking/lockstat.txt (renamed from Documentation/lockstat.txt)2
-rw-r--r--Documentation/locking/mutex-design.txt (renamed from Documentation/mutex-design.txt)0
-rw-r--r--Documentation/locking/rt-mutex-design.txt (renamed from Documentation/rt-mutex-design.txt)0
-rw-r--r--Documentation/locking/rt-mutex.txt (renamed from Documentation/rt-mutex.txt)0
-rw-r--r--Documentation/locking/spinlocks.txt (renamed from Documentation/spinlocks.txt)14
-rw-r--r--Documentation/locking/ww-mutex-design.txt (renamed from Documentation/ww-mutex-design.txt)0
-rw-r--r--MAINTAINERS4
-rw-r--r--drivers/gpu/drm/drm_modeset_lock.c2
-rw-r--r--include/linux/lockdep.h2
-rw-r--r--include/linux/mutex.h2
-rw-r--r--include/linux/rwsem.h2
-rw-r--r--kernel/locking/mutex.c2
-rw-r--r--kernel/locking/rtmutex.c2
-rw-r--r--lib/Kconfig.debug4
17 files changed, 21 insertions, 19 deletions
diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX
index 27e67a98b7be..1750fcef1ab4 100644
--- a/Documentation/00-INDEX
+++ b/Documentation/00-INDEX
@@ -287,6 +287,8 @@ local_ops.txt
287 - semantics and behavior of local atomic operations. 287 - semantics and behavior of local atomic operations.
288lockdep-design.txt 288lockdep-design.txt
289 - documentation on the runtime locking correctness validator. 289 - documentation on the runtime locking correctness validator.
290locking/
291 - directory with info about kernel locking primitives
290lockstat.txt 292lockstat.txt
291 - info on collecting statistics on locks (and contention). 293 - info on collecting statistics on locks (and contention).
292lockup-watchdogs.txt 294lockup-watchdogs.txt
diff --git a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl
index e584ee12a1e7..7c9cc4846cb6 100644
--- a/Documentation/DocBook/kernel-locking.tmpl
+++ b/Documentation/DocBook/kernel-locking.tmpl
@@ -1972,7 +1972,7 @@ machines due to caching.
1972 <itemizedlist> 1972 <itemizedlist>
1973 <listitem> 1973 <listitem>
1974 <para> 1974 <para>
1975 <filename>Documentation/spinlocks.txt</filename>: 1975 <filename>Documentation/locking/spinlocks.txt</filename>:
1976 Linus Torvalds' spinlocking tutorial in the kernel sources. 1976 Linus Torvalds' spinlocking tutorial in the kernel sources.
1977 </para> 1977 </para>
1978 </listitem> 1978 </listitem>
diff --git a/Documentation/lockdep-design.txt b/Documentation/locking/lockdep-design.txt
index 5dbc99c04f6e..5dbc99c04f6e 100644
--- a/Documentation/lockdep-design.txt
+++ b/Documentation/locking/lockdep-design.txt
diff --git a/Documentation/lockstat.txt b/Documentation/locking/lockstat.txt
index 72d010689751..7428773a1e69 100644
--- a/Documentation/lockstat.txt
+++ b/Documentation/locking/lockstat.txt
@@ -12,7 +12,7 @@ Because things like lock contention can severely impact performance.
12- HOW 12- HOW
13 13
14Lockdep already has hooks in the lock functions and maps lock instances to 14Lockdep already has hooks in the lock functions and maps lock instances to
15lock classes. We build on that (see Documentation/lockdep-design.txt). 15lock classes. We build on that (see Documentation/lokcing/lockdep-design.txt).
16The graph below shows the relation between the lock functions and the various 16The graph below shows the relation between the lock functions and the various
17hooks therein. 17hooks therein.
18 18
diff --git a/Documentation/mutex-design.txt b/Documentation/locking/mutex-design.txt
index ee231ed09ec6..ee231ed09ec6 100644
--- a/Documentation/mutex-design.txt
+++ b/Documentation/locking/mutex-design.txt
diff --git a/Documentation/rt-mutex-design.txt b/Documentation/locking/rt-mutex-design.txt
index 8666070d3189..8666070d3189 100644
--- a/Documentation/rt-mutex-design.txt
+++ b/Documentation/locking/rt-mutex-design.txt
diff --git a/Documentation/rt-mutex.txt b/Documentation/locking/rt-mutex.txt
index 243393d882ee..243393d882ee 100644
--- a/Documentation/rt-mutex.txt
+++ b/Documentation/locking/rt-mutex.txt
diff --git a/Documentation/spinlocks.txt b/Documentation/locking/spinlocks.txt
index 97eaf5727178..ff35e40bdf5b 100644
--- a/Documentation/spinlocks.txt
+++ b/Documentation/locking/spinlocks.txt
@@ -105,9 +105,9 @@ never used in interrupt handlers, you can use the non-irq versions:
105 spin_unlock(&lock); 105 spin_unlock(&lock);
106 106
107(and the equivalent read-write versions too, of course). The spinlock will 107(and the equivalent read-write versions too, of course). The spinlock will
108guarantee the same kind of exclusive access, and it will be much faster. 108guarantee the same kind of exclusive access, and it will be much faster.
109This is useful if you know that the data in question is only ever 109This is useful if you know that the data in question is only ever
110manipulated from a "process context", ie no interrupts involved. 110manipulated from a "process context", ie no interrupts involved.
111 111
112The reasons you mustn't use these versions if you have interrupts that 112The reasons you mustn't use these versions if you have interrupts that
113play with the spinlock is that you can get deadlocks: 113play with the spinlock is that you can get deadlocks:
@@ -122,21 +122,21 @@ the other interrupt happens on another CPU, but it is _not_ ok if the
122interrupt happens on the same CPU that already holds the lock, because the 122interrupt happens on the same CPU that already holds the lock, because the
123lock will obviously never be released (because the interrupt is waiting 123lock will obviously never be released (because the interrupt is waiting
124for the lock, and the lock-holder is interrupted by the interrupt and will 124for the lock, and the lock-holder is interrupted by the interrupt and will
125not continue until the interrupt has been processed). 125not continue until the interrupt has been processed).
126 126
127(This is also the reason why the irq-versions of the spinlocks only need 127(This is also the reason why the irq-versions of the spinlocks only need
128to disable the _local_ interrupts - it's ok to use spinlocks in interrupts 128to disable the _local_ interrupts - it's ok to use spinlocks in interrupts
129on other CPU's, because an interrupt on another CPU doesn't interrupt the 129on other CPU's, because an interrupt on another CPU doesn't interrupt the
130CPU that holds the lock, so the lock-holder can continue and eventually 130CPU that holds the lock, so the lock-holder can continue and eventually
131releases the lock). 131releases the lock).
132 132
133Note that you can be clever with read-write locks and interrupts. For 133Note that you can be clever with read-write locks and interrupts. For
134example, if you know that the interrupt only ever gets a read-lock, then 134example, if you know that the interrupt only ever gets a read-lock, then
135you can use a non-irq version of read locks everywhere - because they 135you can use a non-irq version of read locks everywhere - because they
136don't block on each other (and thus there is no dead-lock wrt interrupts. 136don't block on each other (and thus there is no dead-lock wrt interrupts.
137But when you do the write-lock, you have to use the irq-safe version. 137But when you do the write-lock, you have to use the irq-safe version.
138 138
139For an example of being clever with rw-locks, see the "waitqueue_lock" 139For an example of being clever with rw-locks, see the "waitqueue_lock"
140handling in kernel/sched/core.c - nothing ever _changes_ a wait-queue from 140handling in kernel/sched/core.c - nothing ever _changes_ a wait-queue from
141within an interrupt, they only read the queue in order to know whom to 141within an interrupt, they only read the queue in order to know whom to
142wake up. So read-locks are safe (which is good: they are very common 142wake up. So read-locks are safe (which is good: they are very common
diff --git a/Documentation/ww-mutex-design.txt b/Documentation/locking/ww-mutex-design.txt
index 8a112dc304c3..8a112dc304c3 100644
--- a/Documentation/ww-mutex-design.txt
+++ b/Documentation/locking/ww-mutex-design.txt
diff --git a/MAINTAINERS b/MAINTAINERS
index 1acc624ecfd7..aac481fcbf5c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5523,8 +5523,8 @@ M: Ingo Molnar <mingo@redhat.com>
5523L: linux-kernel@vger.kernel.org 5523L: linux-kernel@vger.kernel.org
5524T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/locking 5524T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/locking
5525S: Maintained 5525S: Maintained
5526F: Documentation/lockdep*.txt 5526F: Documentation/locking/lockdep*.txt
5527F: Documentation/lockstat.txt 5527F: Documentation/locking/lockstat.txt
5528F: include/linux/lockdep.h 5528F: include/linux/lockdep.h
5529F: kernel/locking/ 5529F: kernel/locking/
5530 5530
diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c
index 0dc57d5ecd10..3a02e5e3e9f3 100644
--- a/drivers/gpu/drm/drm_modeset_lock.c
+++ b/drivers/gpu/drm/drm_modeset_lock.c
@@ -35,7 +35,7 @@
35 * of extra utility/tracking out of our acquire-ctx. This is provided 35 * of extra utility/tracking out of our acquire-ctx. This is provided
36 * by drm_modeset_lock / drm_modeset_acquire_ctx. 36 * by drm_modeset_lock / drm_modeset_acquire_ctx.
37 * 37 *
38 * For basic principles of ww_mutex, see: Documentation/ww-mutex-design.txt 38 * For basic principles of ww_mutex, see: Documentation/locking/ww-mutex-design.txt
39 * 39 *
40 * The basic usage pattern is to: 40 * The basic usage pattern is to:
41 * 41 *
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 008388f920d7..f388481201cd 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -4,7 +4,7 @@
4 * Copyright (C) 2006,2007 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> 4 * Copyright (C) 2006,2007 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
5 * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com> 5 * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com>
6 * 6 *
7 * see Documentation/lockdep-design.txt for more details. 7 * see Documentation/locking/lockdep-design.txt for more details.
8 */ 8 */
9#ifndef __LINUX_LOCKDEP_H 9#ifndef __LINUX_LOCKDEP_H
10#define __LINUX_LOCKDEP_H 10#define __LINUX_LOCKDEP_H
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index e4c29418f407..cc31498fc526 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -133,7 +133,7 @@ static inline int mutex_is_locked(struct mutex *lock)
133 133
134/* 134/*
135 * See kernel/locking/mutex.c for detailed documentation of these APIs. 135 * See kernel/locking/mutex.c for detailed documentation of these APIs.
136 * Also see Documentation/mutex-design.txt. 136 * Also see Documentation/locking/mutex-design.txt.
137 */ 137 */
138#ifdef CONFIG_DEBUG_LOCK_ALLOC 138#ifdef CONFIG_DEBUG_LOCK_ALLOC
139extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); 139extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass);
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index 035d3c57fc8a..8f498cdde280 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -149,7 +149,7 @@ extern void downgrade_write(struct rw_semaphore *sem);
149 * static then another method for expressing nested locking is 149 * static then another method for expressing nested locking is
150 * the explicit definition of lock class keys and the use of 150 * the explicit definition of lock class keys and the use of
151 * lockdep_set_class() at lock initialization time. 151 * lockdep_set_class() at lock initialization time.
152 * See Documentation/lockdep-design.txt for more details.) 152 * See Documentation/locking/lockdep-design.txt for more details.)
153 */ 153 */
154extern void down_read_nested(struct rw_semaphore *sem, int subclass); 154extern void down_read_nested(struct rw_semaphore *sem, int subclass);
155extern void down_write_nested(struct rw_semaphore *sem, int subclass); 155extern void down_write_nested(struct rw_semaphore *sem, int subclass);
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index 0d8b6ed93874..dadbf88c22c4 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -15,7 +15,7 @@
15 * by Steven Rostedt, based on work by Gregory Haskins, Peter Morreale 15 * by Steven Rostedt, based on work by Gregory Haskins, Peter Morreale
16 * and Sven Dietrich. 16 * and Sven Dietrich.
17 * 17 *
18 * Also see Documentation/mutex-design.txt. 18 * Also see Documentation/locking/mutex-design.txt.
19 */ 19 */
20#include <linux/mutex.h> 20#include <linux/mutex.h>
21#include <linux/ww_mutex.h> 21#include <linux/ww_mutex.h>
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
index a0ea2a141b3b..7c98873a3077 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -8,7 +8,7 @@
8 * Copyright (C) 2005 Kihon Technologies Inc., Steven Rostedt 8 * Copyright (C) 2005 Kihon Technologies Inc., Steven Rostedt
9 * Copyright (C) 2006 Esben Nielsen 9 * Copyright (C) 2006 Esben Nielsen
10 * 10 *
11 * See Documentation/rt-mutex-design.txt for details. 11 * See Documentation/locking/rt-mutex-design.txt for details.
12 */ 12 */
13#include <linux/spinlock.h> 13#include <linux/spinlock.h>
14#include <linux/export.h> 14#include <linux/export.h>
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 901096d31c66..9b94a063e26c 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -924,7 +924,7 @@ config PROVE_LOCKING
924 the proof of observed correctness is also maintained for an 924 the proof of observed correctness is also maintained for an
925 arbitrary combination of these separate locking variants. 925 arbitrary combination of these separate locking variants.
926 926
927 For more details, see Documentation/lockdep-design.txt. 927 For more details, see Documentation/locking/lockdep-design.txt.
928 928
929config LOCKDEP 929config LOCKDEP
930 bool 930 bool
@@ -945,7 +945,7 @@ config LOCK_STAT
945 help 945 help
946 This feature enables tracking lock contention points 946 This feature enables tracking lock contention points
947 947
948 For more details, see Documentation/lockstat.txt 948 For more details, see Documentation/locking/lockstat.txt
949 949
950 This also enables lock events required by "perf lock", 950 This also enables lock events required by "perf lock",
951 subcommand of perf. 951 subcommand of perf.