aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/sparse.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/Documentation/sparse.txt b/Documentation/sparse.txt
index 4909d4116356..eceab1308a8c 100644
--- a/Documentation/sparse.txt
+++ b/Documentation/sparse.txt
@@ -49,6 +49,24 @@ be generated without __CHECK_ENDIAN__.
49__bitwise - noisy stuff; in particular, __le*/__be* are that. We really 49__bitwise - noisy stuff; in particular, __le*/__be* are that. We really
50don't want to drown in noise unless we'd explicitly asked for it. 50don't want to drown in noise unless we'd explicitly asked for it.
51 51
52Using sparse for lock checking
53~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
54
55The following macros are undefined for gcc and defined during a sparse
56run to use the "context" tracking feature of sparse, applied to
57locking. These annotations tell sparse when a lock is held, with
58regard to the annotated function's entry and exit.
59
60__must_hold - The specified lock is held on function entry and exit.
61
62__acquires - The specified lock is held on function exit, but not entry.
63
64__releases - The specified lock is held on function entry, but not exit.
65
66If the function enters and exits without the lock held, acquiring and
67releasing the lock inside the function in a balanced way, no
68annotation is needed. The tree annotations above are for cases where
69sparse would otherwise report a context imbalance.
52 70
53Getting sparse 71Getting sparse
54~~~~~~~~~~~~~~ 72~~~~~~~~~~~~~~