lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110608234855.GE25771@somewhere.redhat.com>
Date:	Thu, 9 Jun 2011 01:48:57 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, laijs@...fujitsu.com,
	dipankar@...ibm.com, akpm@...ux-foundation.org,
	mathieu.desnoyers@...ymtl.ca, josh@...htriplett.org,
	niv@...ibm.com, tglx@...utronix.de, peterz@...radead.org,
	rostedt@...dmis.org, Valdis.Kletnieks@...edu, dhowells@...hat.com,
	eric.dumazet@...il.com, darren@...art.com, patches@...aro.org
Subject: Re: [PATCH tip/core/rcu 04/28] rcu: Restore checks for blocking in
 RCU read-side critical sections

On Wed, Jun 08, 2011 at 04:46:22PM -0700, Paul E. McKenney wrote:
> On Thu, Jun 09, 2011 at 01:28:35AM +0200, Frederic Weisbecker wrote:
> > On Wed, Jun 08, 2011 at 12:29:43PM -0700, Paul E. McKenney wrote:
> > > Long ago, using TREE_RCU with PREEMPT would result in "scheduling
> > > while atomic" diagnostics if you blocked in an RCU read-side critical
> > > section.  However, PREEMPT now implies TREE_PREEMPT_RCU, which defeats
> > > this diagnostic.  This commit therefore adds a replacement diagnostic
> > > based on PROVE_RCU.
> > > 
> > > Because rcu_lockdep_assert() and lockdep_rcu_dereference() are now being
> > > used for things that have nothing to do with rcu_dereference(), rename
> > > lockdep_rcu_dereference() to lockdep_rcu_suspicious() and add a third
> > > argument that is a string indicating what is suspicious.  This third
> > > argument is passed in from a new third argument to rcu_lockdep_assert().
> > > Update all calls to rcu_lockdep_assert() to add an informative third
> > > argument.
> > > 
> > > Finally, add a pair of rcu_lockdep_assert() calls from within
> > > rcu_note_context_switch(), one complaining if a context switch occurs
> > > in an RCU-bh read-side critical section and another complaining if a
> > > context switch occurs in an RCU-sched read-side critical section.
> > > These are present only if the PROVE_RCU kernel parameter is enabled.
> > > 
> > > Again, you must enable PROVE_RCU to see these new diagnostics.  But you
> > > are enabling PROVE_RCU to check out new RCU uses in any case, aren't you?
> > > 
> > > Signed-off-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
> > 
> > So, do you think we can get rid of this patch now that we are going to have CONFIG_ATOMIC_SLEEP
> > working everywhere?
> > 
> > The last remaining piece we need is to check rcu_preempt_depth() from schedule_debug(),
> > which does a kind of lightweight might_sleep() check alike.
> 
> I believe that we need them both.  Your patch provides a lightweight
> check.  Mine is way heavier weight (CONFIG_PROVE_RCU is required), but
> tells you in what function the offending RCU read-side critical section
> was entered.

Well, that can be found easily in the stacktrace. But ok.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ