diff options
author | Michal Hocko <mhocko@suse.cz> | 2011-07-08 11:48:24 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2011-09-29 00:38:23 -0400 |
commit | e5177ec77d503636d0b609671c9d408b981add17 (patch) | |
tree | d6a8e7fa1790fe04caa2d6afeabd8f09f95b5555 /Documentation/RCU | |
parent | e4cc1f22b2f4e9b0207a8cdb63e56dcf99e82d35 (diff) |
rcu: Not necessary to pass rcu_read_lock_held() to rcu_dereference_protected()
Since ca5ecddf (rcu: define __rcu address space modifier for sparse)
rcu_dereference_check() use rcu_read_lock_held() as a part of condition
automatically. Therefore, callers of rcu_dereference_check() no longer
need to pass rcu_read_lock_held() to rcu_dereference_check().
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'Documentation/RCU')
-rw-r--r-- | Documentation/RCU/lockdep.txt | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Documentation/RCU/lockdep.txt b/Documentation/RCU/lockdep.txt index d7a49b2f6994..4998c633e20a 100644 --- a/Documentation/RCU/lockdep.txt +++ b/Documentation/RCU/lockdep.txt | |||
@@ -48,13 +48,11 @@ checking of rcu_dereference() primitives: | |||
48 | value of the pointer itself, for example, against NULL. | 48 | value of the pointer itself, for example, against NULL. |
49 | 49 | ||
50 | The rcu_dereference_check() check expression can be any boolean | 50 | The rcu_dereference_check() check expression can be any boolean |
51 | expression, but would normally include one of the rcu_read_lock_held() | 51 | expression, but would normally include a lockdep expression. However, |
52 | family of functions and a lockdep expression. However, any boolean | 52 | any boolean expression can be used. For a moderately ornate example, |
53 | expression can be used. For a moderately ornate example, consider | 53 | consider the following: |
54 | the following: | ||
55 | 54 | ||
56 | file = rcu_dereference_check(fdt->fd[fd], | 55 | file = rcu_dereference_check(fdt->fd[fd], |
57 | rcu_read_lock_held() || | ||
58 | lockdep_is_held(&files->file_lock) || | 56 | lockdep_is_held(&files->file_lock) || |
59 | atomic_read(&files->count) == 1); | 57 | atomic_read(&files->count) == 1); |
60 | 58 | ||
@@ -62,7 +60,7 @@ This expression picks up the pointer "fdt->fd[fd]" in an RCU-safe manner, | |||
62 | and, if CONFIG_PROVE_RCU is configured, verifies that this expression | 60 | and, if CONFIG_PROVE_RCU is configured, verifies that this expression |
63 | is used in: | 61 | is used in: |
64 | 62 | ||
65 | 1. An RCU read-side critical section, or | 63 | 1. An RCU read-side critical section (implicit), or |
66 | 2. with files->file_lock held, or | 64 | 2. with files->file_lock held, or |
67 | 3. on an unshared files_struct. | 65 | 3. on an unshared files_struct. |
68 | 66 | ||