Skip to content

Commit

Permalink
rcu: Not necessary to pass rcu_read_lock_held() to rcu_dereference_pr…
Browse files Browse the repository at this point in the history
…otected()

Since ca5ecdd (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>
  • Loading branch information
Michal Hocko authored and Paul E. McKenney committed Sep 29, 2011
1 parent e4cc1f2 commit e5177ec
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Documentation/RCU/lockdep.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,19 @@ checking of rcu_dereference() primitives:
value of the pointer itself, for example, against NULL.

The rcu_dereference_check() check expression can be any boolean
expression, but would normally include one of the rcu_read_lock_held()
family of functions and a lockdep expression. However, any boolean
expression can be used. For a moderately ornate example, consider
the following:
expression, but would normally include a lockdep expression. However,
any boolean expression can be used. For a moderately ornate example,
consider the following:

file = rcu_dereference_check(fdt->fd[fd],
rcu_read_lock_held() ||
lockdep_is_held(&files->file_lock) ||
atomic_read(&files->count) == 1);

This expression picks up the pointer "fdt->fd[fd]" in an RCU-safe manner,
and, if CONFIG_PROVE_RCU is configured, verifies that this expression
is used in:

1. An RCU read-side critical section, or
1. An RCU read-side critical section (implicit), or
2. with files->file_lock held, or
3. on an unshared files_struct.

Expand Down

0 comments on commit e5177ec

Please sign in to comment.