login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
April
»
7
Re: [PATCH] RCU: Better explain the condition parameter of rcu_dereference_check()
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Paul E. McKenney
Subject:
Re: [PATCH] RCU: Better explain the condition parameter of rcu_dereference_check()
Date: Wednesday, April 7, 2010 - 10:28 am
On Wed, Apr 07, 2010 at 06:15:00PM +0100, David Howells wrote:
quoted text
> Better explain the condition parameter of rcu_dereference_check() that > describes the conditions under which the dereference is permitted to take > place. This condition is only checked under lockdep proving.
Very good, I have queued this. Thank you! Thanx, Paul
quoted text
> Signed-off-by: David Howells <dhowells@redhat.com> > --- > > include/linux/rcupdate.h | 28 +++++++++++++++++++++++----- > 1 files changed, 23 insertions(+), 5 deletions(-) > > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h > index 872a98e..acf9958 100644 > --- a/include/linux/rcupdate.h > +++ b/include/linux/rcupdate.h > @@ -195,12 +195,30 @@ static inline int rcu_read_lock_sched_held(void) > > /** > * rcu_dereference_check - rcu_dereference with debug checking > + * @p: The pointer to read, prior to dereferencing > + * @c: The conditions under which the dereference will take place > * > - * Do an rcu_dereference(), but check that the context is correct. > - * For example, rcu_dereference_check(gp, rcu_read_lock_held()) to > - * ensure that the rcu_dereference_check() executes within an RCU > - * read-side critical section. It is also possible to check for > - * locks being held, for example, by using lockdep_is_held(). > + * Do an rcu_dereference(), but check that the conditions under which the > + * dereference will take place are correct. Typically the conditions indicate > + * the various locking conditions that should be held at that point. The check > + * should return true if the conditions are satisfied. > + * > + * For example: > + * > + * bar = rcu_dereference_check(foo->bar, rcu_read_lock_held() || > + * lockdep_is_held(&foo->lock)); > + * > + * could be used to indicate to lockdep that foo->bar may only be dereferenced > + * if either the RCU read lock is held, or that the lock required to replace > + * the bar struct at foo->bar is held. > + * > + * Note that the list of conditions may also include indications of when a lock > + * need not be held, for example during initialisation or destruction of the > + * target struct: > + * > + * bar = rcu_dereference_check(foo->bar, rcu_read_lock_held() || > + * lockdep_is_held(&foo->lock), > + * atomic_read(&foo->usage) == 0); > */ > #define rcu_dereference_check(p, c) \ > ({ \ >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] RCU: Better explain the condition parameter of rcu ...
, David Howells
, (Wed Apr 7, 10:15 am)
Re: [PATCH] RCU: Better explain the condition parameter of ...
, Paul E. McKenney
, (Wed Apr 7, 10:28 am)
Re: [PATCH] RCU: Better explain the condition parameter of ...
, Yong Zhang
, (Wed Apr 7, 7:50 pm)
Re: [PATCH] RCU: Better explain the condition parameter of ...
, Paul E. McKenney
, (Wed Apr 7, 9:36 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ken Chen
[patch] sched: fix inconsistency when redistribute per-cpu tg->cfs_rq shares.
Ingo Molnar
Re: [PATCH v3] x86: merge the simple bitops and move them to bitops.h
Paul Turner
[tg_shares_up rewrite v4 11/11] sched: update tg->shares after cpu.shares write
Andi Kleen
Re: - romsignature-checksum-cleanup-2.patch removed from -mm tree
Yinghai Lu
[PATCH 09/49] memblock: Remove rmo_size, burry it in arch/powerpc where it belongs
git
:
Junio C Hamano
Re: Teach "git checkout" to use git-show-ref
Christian Jaeger
Re: Problem with Git.pm bidi_pipe methods
Linus Torvalds
[PATCH 1/7] Make unpack_trees_options bit flags actual bitfields
Jon Smirl
stgit: managing signed-off-by lines
Han-Wen Nienhuys
Re: Cleaning up git user-interface warts
git-commits-head
:
Linux Kernel Mailing List
MIPS: Bonito64: Make Loongson independent from Bonito64 code.
Linux Kernel Mailing List
iwlwifi: initialize spinlock before use
Linux Kernel Mailing List
i2c-i801: Add Intel Cougar Point device IDs
Linux Kernel Mailing List
drm/i915: Add information on pinning and fencing to the i915 list debug.
Linux Kernel Mailing List
Btrfs: Disable btree reada during extent backref lookups.
linux-netdev
:
Gerrit Renker
v2 [PATCH 1/4] dccp: Limit feature negotiation to connection setup phase
Richard Cochran
Re: [PATCH v3 3/3] ptp: Added a clock that uses the eTSEC found on the MPC85xx.
Inaky Perez-Gonzalez
[PATCH 40/40] wimax/i2400m: add CREDITS and MAINTAINERS entries
Miloslav Trmac
Re: RFC: Crypto API User-interface
David Miller
Re: [net-next-2.6 PATCH] ixgbevf: Refactor ring parameter re-size
freebsd-current
:
Boris Samorodov
Re: twa + dump = sbwait
韓家標 Bill Hacker
Re: ZFS honesty
Bjoern A. Zeeb
Re: Can not boot 7.0-BETA3 with IPSEC
FreeBSD Tinderbox
[head tinderbox] failure on i386/i386
Rong-en Fan
ad0: setting up DMA failed / FAILURE - load data ?
Colocation donated by:
Syndicate