Skip to content

rcu: v3 add lockdep-based diagnostics to rcu_dereference()

Paul E. McKenney lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9rcu: introduce lockdep-based checking to RCU read-side primitivesinclude/linux/rcupdate.h include/linux/srcu.h kernel/rcupdate.c +4 more+267 -310 replies
2/9rcu: add lockdep-enabled variants of rcu_dereference()include/linux/rcupdate.h include/linux/srcu.h+42 -70 replies
3/9rcu: disable lockdep checking in RCU list-traversal primitivesinclude/linux/rculist.h include/linux/rculist_nulls.h+9 -90 replies
4/9net: add checking to rcu_dereference() primitivesnet/core/dev.c net/core/filter.c net/core/sock.c +3 more+20 -200 replies
5/9sched: use lockdep-based checking on rcu_dereference()include/linux/cgroup.h include/linux/cred.h init/main.c +6 more+43 -120 replies
6/9vfs: apply lockdep-based checking to rcu_dereference() usesfs/file.c fs/proc/array.c fs/proc/base.c +1 more+14 -40 replies
7/9radix-tree: disable RCU lockdep checking in radix treelib/radix-tree.c+12 -120 replies
8/9idr: apply lockdep-based diagnostics to rcu_dereference() useslib/idr.c+4 -42 replies
9/9rcu: documentation update for CONFIG_PROVE_RCUDocumentation/RCU/00-INDEX Documentation/RCU/checklist.txt Documentation/RCU/lockdep.txt +1 more+97 -190 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH tip/core/rcu 0/9] rcu: v3 add lockdep-based diagnostics to rcu_dereference()

Hello!

This patch series adds lockdep-based checking to the rcu_dereference() primitive in order to flag misuses of RCU. The first three patches put the RCU infrastructure in place, the next five use this infrastructure in the net, sched, vfs, radix-tree, and idr subsystems, and the last patch documents how to use the new lockdep-checked rcu_dereference() primitives.

The new (and default-disabled) CONFIG_PROVE_RCU makes this safe to include in tip/core/rcu -- unlike v2, your system won't complain about RCU misuse unless you ask it to. There are still several situations that trigger on systems I have access to (and I have email out on a couple of them), some of the remaining will be triggered only by hardware I don't have access to and kernel features I am unfamiliar with. So this is ready for some more-general testing.

Changes since v2 (http://lkml.org/lkml/2010/1/4/496):

o Removed references to the check condition for the non-lockdep
version of rcu_dereference_check(), thus preventing numerous build errors.

o Create a CONFIG_PROVE_RCU (default disabled) so that developers
who want to use lockdep only to debug locks aren't bothered by RCU-specific lockdep complaints that will no doubt persist for a little bit while some of the more obscure uses of RCU are reverse-engineered.

o Fix a few more issues identified by the checking.

o Add documentation in Documentation/RCU/lockdep.txt.

Changes since v1 (http://lkml.org/lkml/2009/12/15/553):

o Made SRCU have per-srcu_struct lockdep maps to prevent lockdep
from conflating independent uses of SRCU, and updated the rcu_dereference() checking in rcutorture to match.

o Fix a few issues identified by the checking.

o Disable checking within RCU list macros, RCU radix trees, and
IDR.