public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: paulmck@linux.vnet.ibm.com
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	RT <linux-rt-users@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH RT] put in a relatively high number for rcu read lock upper limit.
Date: Sun, 05 Aug 2007 11:35:00 -0400	[thread overview]
Message-ID: <1186328100.636.19.camel@localhost.localdomain> (raw)
In-Reply-To: <20070805150449.GA19418@linux.vnet.ibm.com>

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 <rostedt@goodmis.org>

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);
 }
 



  reply	other threads:[~2007-08-05 15:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-05  4:51 [BUG RT] - rcupreempt.c:133 on 2.6.23-rc1-rt7 Steven Rostedt
2007-08-05  5:05 ` Steven Rostedt
2007-08-05  6:59   ` Ingo Molnar
2007-08-05 14:24     ` Steven Rostedt
2007-08-05 15:04       ` Paul E. McKenney
2007-08-05 15:35         ` Steven Rostedt [this message]
2007-08-05 17:53           ` [PATCH RT] put in a relatively high number for rcu read lock upper limit Ingo Molnar
2007-08-05 17:58             ` Steven Rostedt
2007-08-06  3:20             ` Paul E. McKenney
2007-08-05 15:26       ` [BUG RT] - rcupreempt.c:133 on 2.6.23-rc1-rt7 Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1186328100.636.19.camel@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox