All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH tip/core/rcu 0/21] v6 add lockdep-based diagnostics to rcu_dereference()
@ 2010-02-23  1:04 Paul E. McKenney
  2010-02-23  1:04 ` [PATCH tip/core/rcu 01/21] rcu: introduce lockdep-based checking to RCU read-side primitives Paul E. McKenney
                   ` (22 more replies)
  0 siblings, 23 replies; 85+ messages in thread
From: Paul E. McKenney @ 2010-02-23  1:04 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, dvhltc,
	niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells

Hello!

This patch series adds lockdep-based checking to the rcu_dereference()
primitive in order to flag misuses of RCU.  The first four patches put
the RCU infrastructure in place, the next eight use this infrastructure
in the net, sched, vfs, radix-tree, idr, and security subsystems, and
patch 13 documents how to use the new lockdep-checked rcu_dereference()
primitives.  The remaining eight patches are other changes that also need
to be applied, including some relatively urgent RCU_STALL patches.

The new (and default-disabled) CONFIG_PROVE_RCU makes this safe to
include in tip/core/rcu -- unlike v2 and earlier, 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 much wider testing.

Changes since v5 (http://lkml.org/lkml/2010/2/17/271)

o	Fix a deadlock located by Thomas Gleixner that affects
	TREE_PREEMPT_RCU in some CPU-stall detection scenarios.

o	Add Dan Carpenter's cleanup to a mod_timer() in rcutorture.

o	Add a RCU_CPU_STALL_VERBOSE to enable dumping more information
	on tasks stalling the current RCU grace period.

o	Applied Acked-by lines that people have sent (thank you all!).

Changes since v4 (http://lkml.org/lkml/2010/2/11/356)

o	Apply review comments from Peter Ziljstra.

o	Another documentation update.

o	Fixes that avoid overflowing signed integers.

o	Rebased Thomas Gleixner's raw-spinlock patch on this series.
	(Thomas's original at http://lkml.org/lkml/2010/2/17/182.)

Changes since v3 (http://lkml.org/lkml/2010/1/14/505)

o	Fix a few more issues identified by the checking.

o	Add a documentation update.

o	Accelerate RCU grace periods when the current CPU is the last
	non-dyntick-idle CPU in the system, which is important for
	some multi-core battery-powered devices.

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.

^ permalink raw reply	[flat|nested] 85+ messages in thread
* [PATCH tip/core/rcu 7/8] radix-tree: disable RCU lockdep checking in radix tree
@ 2010-01-05  2:04 Paul E. McKenney
  2010-01-13 10:29 ` [tip:core/rcu] radix-tree: Disable " tip-bot for Paul E. McKenney
  0 siblings, 1 reply; 85+ messages in thread
From: Paul E. McKenney @ 2010-01-05  2:04 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, dvhltc,
	niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells,
	Paul E. McKenney

From: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

Because the radix tree is used with many different locking designs, we
cannot do any effective checking without changing the radix-tree APIs.
It might make sense to do this later, but only if the RCU lockdep checking
proves itself sufficiently valuable.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 lib/radix-tree.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index 23abbd9..46724e2 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -361,7 +361,7 @@ static void *radix_tree_lookup_element(struct radix_tree_root *root,
 	unsigned int height, shift;
 	struct radix_tree_node *node, **slot;
 
-	node = rcu_dereference(root->rnode);
+	node = rcu_dereference_raw(root->rnode);
 	if (node == NULL)
 		return NULL;
 
@@ -381,7 +381,7 @@ static void *radix_tree_lookup_element(struct radix_tree_root *root,
 	do {
 		slot = (struct radix_tree_node **)
 			(node->slots + ((index>>shift) & RADIX_TREE_MAP_MASK));
-		node = rcu_dereference(*slot);
+		node = rcu_dereference_raw(*slot);
 		if (node == NULL)
 			return NULL;
 
@@ -566,7 +566,7 @@ int radix_tree_tag_get(struct radix_tree_root *root,
 	if (!root_tag_get(root, tag))
 		return 0;
 
-	node = rcu_dereference(root->rnode);
+	node = rcu_dereference_raw(root->rnode);
 	if (node == NULL)
 		return 0;
 
@@ -600,7 +600,7 @@ int radix_tree_tag_get(struct radix_tree_root *root,
 			BUG_ON(ret && saw_unset_tag);
 			return !!ret;
 		}
-		node = rcu_dereference(node->slots[offset]);
+		node = rcu_dereference_raw(node->slots[offset]);
 		shift -= RADIX_TREE_MAP_SHIFT;
 		height--;
 	}
@@ -710,7 +710,7 @@ __lookup(struct radix_tree_node *slot, void ***results, unsigned long index,
 		}
 
 		shift -= RADIX_TREE_MAP_SHIFT;
-		slot = rcu_dereference(slot->slots[i]);
+		slot = rcu_dereference_raw(slot->slots[i]);
 		if (slot == NULL)
 			goto out;
 	}
@@ -757,7 +757,7 @@ radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
 	unsigned long cur_index = first_index;
 	unsigned int ret;
 
-	node = rcu_dereference(root->rnode);
+	node = rcu_dereference_raw(root->rnode);
 	if (!node)
 		return 0;
 
@@ -786,7 +786,7 @@ radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
 			slot = *(((void ***)results)[ret + i]);
 			if (!slot)
 				continue;
-			results[ret + nr_found] = rcu_dereference(slot);
+			results[ret + nr_found] = rcu_dereference_raw(slot);
 			nr_found++;
 		}
 		ret += nr_found;
@@ -825,7 +825,7 @@ radix_tree_gang_lookup_slot(struct radix_tree_root *root, void ***results,
 	unsigned long cur_index = first_index;
 	unsigned int ret;
 
-	node = rcu_dereference(root->rnode);
+	node = rcu_dereference_raw(root->rnode);
 	if (!node)
 		return 0;
 
@@ -914,7 +914,7 @@ __lookup_tag(struct radix_tree_node *slot, void ***results, unsigned long index,
 			}
 		}
 		shift -= RADIX_TREE_MAP_SHIFT;
-		slot = rcu_dereference(slot->slots[i]);
+		slot = rcu_dereference_raw(slot->slots[i]);
 		if (slot == NULL)
 			break;
 	}
@@ -950,7 +950,7 @@ radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results,
 	if (!root_tag_get(root, tag))
 		return 0;
 
-	node = rcu_dereference(root->rnode);
+	node = rcu_dereference_raw(root->rnode);
 	if (!node)
 		return 0;
 
@@ -979,7 +979,7 @@ radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results,
 			slot = *(((void ***)results)[ret + i]);
 			if (!slot)
 				continue;
-			results[ret + nr_found] = rcu_dereference(slot);
+			results[ret + nr_found] = rcu_dereference_raw(slot);
 			nr_found++;
 		}
 		ret += nr_found;
@@ -1019,7 +1019,7 @@ radix_tree_gang_lookup_tag_slot(struct radix_tree_root *root, void ***results,
 	if (!root_tag_get(root, tag))
 		return 0;
 
-	node = rcu_dereference(root->rnode);
+	node = rcu_dereference_raw(root->rnode);
 	if (!node)
 		return 0;
 
-- 
1.5.2.5


^ permalink raw reply related	[flat|nested] 85+ messages in thread

end of thread, other threads:[~2010-02-26  2:12 UTC | newest]

Thread overview: 85+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-23  1:04 [PATCH tip/core/rcu 0/21] v6 add lockdep-based diagnostics to rcu_dereference() Paul E. McKenney
2010-02-23  1:04 ` [PATCH tip/core/rcu 01/21] rcu: introduce lockdep-based checking to RCU read-side primitives Paul E. McKenney
2010-02-25 10:09   ` [tip:core/rcu] rcu: Introduce " tip-bot for Paul E. McKenney
2010-02-23  1:04 ` [PATCH tip/core/rcu 02/21] rcu: add lockdep-enabled variants of rcu_dereference() Paul E. McKenney
2010-02-25 10:09   ` [tip:core/rcu] rcu: Add " tip-bot for Paul E. McKenney
2010-02-23  1:04 ` [PATCH tip/core/rcu 03/21] rcu: integrate rcu_dereference_check() message into lockdep Paul E. McKenney
2010-02-25 10:09   ` [tip:core/rcu] rcu: Integrate " tip-bot for Paul E. McKenney
2010-02-23  1:04 ` [PATCH tip/core/rcu 04/21] rcu: disable lockdep checking in RCU list-traversal primitives Paul E. McKenney
2010-02-25 10:10   ` [tip:core/rcu] rcu: Disable " tip-bot for Paul E. McKenney
2010-02-23  1:04 ` [PATCH tip/core/rcu 05/21] net: add checking to rcu_dereference() primitives Paul E. McKenney
2010-02-25 10:10   ` [tip:core/rcu] net: Add " tip-bot for Paul E. McKenney
2010-02-23  1:04 ` [PATCH tip/core/rcu 06/21] sched: use lockdep-based checking on rcu_dereference() Paul E. McKenney
2010-02-25 10:11   ` [tip:core/rcu] sched: Use " tip-bot for Paul E. McKenney
2010-02-25 11:06   ` [tip:core/rcu] sched, cgroups: Fix module export tip-bot for Ingo Molnar
2010-02-23  1:04 ` [PATCH tip/core/rcu 07/21] sched: better name for for_each_domain_rd Paul E. McKenney
2010-02-25 10:11   ` [tip:core/rcu] sched: Better " tip-bot for Paul E. McKenney
2010-02-23  1:04 ` [PATCH tip/core/rcu 08/21] vfs: apply lockdep-based checking to rcu_dereference() uses Paul E. McKenney
2010-02-25 10:11   ` [tip:core/rcu] vfs: Apply " tip-bot for Paul E. McKenney
2010-02-23  1:04 ` [PATCH tip/core/rcu 09/21] vfs: abstract rcu_dereference_check for files-fdtable use Paul E. McKenney
2010-02-25 10:11   ` [tip:core/rcu] vfs: Abstract " tip-bot for Paul E. McKenney
2010-02-23  1:04 ` [PATCH tip/core/rcu 10/21] radix-tree: disable RCU lockdep checking in radix tree Paul E. McKenney
2010-02-25 10:12   ` [tip:core/rcu] radix-tree: Disable " tip-bot for Paul E. McKenney
2010-02-23  1:04 ` [PATCH tip/core/rcu 11/21] idr: apply lockdep-based diagnostics to rcu_dereference() uses Paul E. McKenney
2010-02-25 10:12   ` [tip:core/rcu] idr: Apply " tip-bot for Paul E. McKenney
2010-02-23  1:04 ` [PATCH tip/core/rcu 12/21] security: apply lockdep-based checking " Paul E. McKenney
2010-02-25 10:12   ` [tip:core/rcu] security: Apply " tip-bot for Paul E. McKenney
2010-02-23  1:04 ` [PATCH tip/core/rcu 13/21] rcu: documentation update for CONFIG_PROVE_RCU Paul E. McKenney
2010-02-25 10:12   ` [tip:core/rcu] rcu: Documentation " tip-bot for Paul E. McKenney
2010-02-23  1:04 ` [PATCH tip/core/rcu 14/21] rcu: fix citation of Mathieu's dissertation Paul E. McKenney
2010-02-25 10:13   ` [tip:core/rcu] rcu: Fix " tip-bot for Paul E. McKenney
2010-02-23  1:04 ` [PATCH tip/core/rcu 15/21] rcu: accelerate grace period if last non-dynticked CPU Paul E. McKenney
2010-02-25 10:13   ` [tip:core/rcu] rcu: Accelerate " tip-bot for Paul E. McKenney
2010-02-23  1:05 ` [PATCH tip/core/rcu 16/21] rcu: use canonical URL for Mathieu's dissertation Paul E. McKenney
2010-02-25 10:13   ` [tip:core/rcu] rcu: Use " tip-bot for Paul E. McKenney
2010-02-23  1:05 ` [PATCH tip/core/rcu 17/21] rcu: stop overflowing signed integers Paul E. McKenney
2010-02-25 10:14   ` [tip:core/rcu] rcu: Stop " tip-bot for Paul E. McKenney
2010-02-23  1:05 ` [PATCH tip/core/rcu 18/21] rcu: Convert to raw_spinlocks Paul E. McKenney
2010-02-25 10:14   ` [tip:core/rcu] " tip-bot for Paul E. McKenney
2010-02-23  1:05 ` [PATCH tip/core/rcu 19/21] rcu: fix deadlock in TREE_PREEMPT_RCU CPU stall detection Paul E. McKenney
2010-02-25 10:14   ` [tip:core/rcu] rcu: Fix " tip-bot for Paul E. McKenney
2010-02-23  1:05 ` [PATCH tip/core/rcu 20/21] rcu: fix rcutorture mod_timer argument to delay one jiffy Paul E. McKenney
2010-02-25 10:14   ` [tip:core/rcu] rcu: Fix " tip-bot for Paul E. McKenney
2010-02-23  1:05 ` [PATCH tip/core/rcu 21/21] rcu: add RCU_CPU_STALL_VERBOSE to dump detailed per-task information Paul E. McKenney
2010-02-25 10:15   ` [tip:core/rcu] rcu: Add " tip-bot for Paul E. McKenney
2010-02-23 12:59 ` [PATCH tip/core/rcu 0/21] v6 add lockdep-based diagnostics to rcu_dereference() Arnd Bergmann
2010-02-23 13:15   ` Mathieu Desnoyers
2010-02-23 14:35     ` Paul E. McKenney
2010-02-23 15:54     ` Arnd Bergmann
2010-02-23 16:16       ` Paul E. McKenney
2010-02-23 17:15         ` Arnd Bergmann
2010-02-23 18:01           ` Paul E. McKenney
2010-02-24 20:03             ` [PATCH 00/10] __rcu annotations, first draft Arnd Bergmann
2010-02-24 22:18               ` Paul E. McKenney
2010-02-25  8:37               ` Ingo Molnar
2010-02-24 20:03             ` [PATCH 01/10] rcu: define __rcu address space modifier for sparse Arnd Bergmann
2010-02-24 20:12               ` Mathieu Desnoyers
2010-02-24 20:22                 ` Arnd Bergmann
2010-02-24 20:03             ` [PATCH 02/10] rcu: annotated list rcu code Arnd Bergmann
2010-02-24 20:15               ` Mathieu Desnoyers
2010-02-24 20:32                 ` Arnd Bergmann
2010-02-24 20:03             ` [PATCH 03/10] cgroups: __rcu annotations Arnd Bergmann
2010-02-24 20:04             ` [PATCH 04/10] credentials: rcu annotation Arnd Bergmann
2010-02-24 20:04             ` [PATCH 05/10] perf_event: __rcu annotations Arnd Bergmann
2010-02-24 20:04             ` [PATCH 06/10] audit: " Arnd Bergmann
2010-02-24 20:04             ` [PATCH 07/10] module: " Arnd Bergmann
2010-02-24 20:13               ` Alexey Dobriyan
2010-02-24 20:26                 ` Arnd Bergmann
2010-02-24 22:17                   ` Paul E. McKenney
2010-02-24 23:07                     ` Arnd Bergmann
2010-02-24 23:59                       ` Paul E. McKenney
2010-02-25 17:06                         ` Paul E. McKenney
2010-02-25 18:10                           ` Arnd Bergmann
2010-02-25 20:05                             ` Paul E. McKenney
2010-02-26  2:12                               ` Paul E. McKenney
2010-02-24 20:04             ` [PATCH 08/10] pid: " Arnd Bergmann
2010-02-24 20:04             ` [PATCH 09/10] notifiers: " Arnd Bergmann
2010-02-24 20:04             ` [PATCH 10/10] scheduler: " Arnd Bergmann
2010-02-23 13:28   ` [PATCH tip/core/rcu 0/21] v6 add lockdep-based diagnostics to rcu_dereference() Paul E. McKenney
2010-02-25 10:00 ` Ingo Molnar
2010-02-25 10:01   ` Ingo Molnar
2010-02-25 12:04     ` Ingo Molnar
2010-02-25 18:18       ` Paul E. McKenney
2010-02-25 21:36         ` Paul E. McKenney
2010-02-25 21:22       ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2010-01-05  2:04 [PATCH tip/core/rcu 7/8] radix-tree: disable RCU lockdep checking in radix tree Paul E. McKenney
2010-01-13 10:29 ` [tip:core/rcu] radix-tree: Disable " tip-bot for Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.