[PATCH RT] put in a relatively high number for rcu read lock upper limit.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul and Ingo,

Should we just remove the upper limit check, or is something like this
patch sound?

-- Steve

When DEBUG_KERNEL is set, place an upper bound limit on the rcu read
lock set to 100. If we go that deep, then a warn on will print.

Signed-off-by: Steven Rostedt <[email protected]>

Index: linux-2.6.23-rc1-rt7/kernel/rcupreempt.c
===================================================================
--- linux-2.6.23-rc1-rt7.orig/kernel/rcupreempt.c	2007-08-05 11:25:38.000000000 -0400
+++ linux-2.6.23-rc1-rt7/kernel/rcupreempt.c	2007-08-05 11:30:33.000000000 -0400
@@ -50,6 +50,14 @@
 #include <linux/cpumask.h>
 #include <linux/rcupreempt_trace.h>
 
+#ifdef CONFIG_DEBUG_KERNEL
+/* Picking 100 as a high enough limit on rcu read lock nesting. */
+# define rcu_read_lock_check_upper_limit() \
+		WARN_ON_ONCE(current->rcu_read_lock_nesting > 100);
+#else
+# define rcu_read_lock_check_upper_limit() do { } while(0)
+#endif
+
 /*
  * PREEMPT_RCU data structures.
  */
@@ -129,9 +137,9 @@ void __rcu_read_lock(void)
 			atomic_inc(current->rcu_flipctr2);
 			smp_mb__after_atomic_inc();  /* might optimize out... */
 		}
-	} else {
-		WARN_ON_ONCE(current->rcu_read_lock_nesting > NR_CPUS);
-	}
+	} else
+		rcu_read_lock_check_upper_limit();
+
 	local_irq_restore(oldirq);
 }
 


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux