public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	akpm@linux-foundation.org, Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, laijs@cn.fujitsu.com,
	dipankar@in.ibm.com, josh@joshtriplett.org, dvhltc@us.ibm.com,
	niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, Valdis.Kletnieks@vt.edu,
	dhowells@redhat.com, eric.dumazet@gmail.com
Subject: Re: [RFC patch 2/3] tree/tiny rcu: Add debug RCU head objects (v3)
Date: Fri, 19 Mar 2010 15:49:32 -0700	[thread overview]
Message-ID: <20100319224932.GE2520@linux.vnet.ibm.com> (raw)
In-Reply-To: <20100319221000.GA5276@x200>

On Sat, Mar 20, 2010 at 12:10:00AM +0200, Alexey Dobriyan wrote:
> On Fri, Mar 19, 2010 at 04:47:41PM -0400, Mathieu Desnoyers wrote:
> > Helps finding racy users of call_rcu(), which results in hangs because list
> > entries are overwritten and/or skipped.
> > 
> > This new patch version is based on the debugobjects with the newly introduced
> > "active state" tracker.
> > 
> > Non-initialized entries are all considered as "statically initialized". An
> > activation fixup (triggered by call_rcu()) takes care of performing the debug
> > object initialization without issuing any warning. Since we cannot increase the
> > size of struct rcu_head, I don't see much room to put an identifier for
> > statically initialized rcu_head structures. So for now, we have to live without
> > "activation without explicit init" detection. But the main purpose of this debug
> > option is to detect double-activations (double call_rcu() use of a rcu_head
> > before the callback is executed), which is correctly addressed here.
> > 
> > This also detects potential internal RCU callback corruption, which would cause
> > the callbacks to be executed twice.
> 
> Is this useful?
> 
> Basic usage is so there no double call_rcu():
> 
> 	if (atomic_dec_and_test())
> 		call_rcu()

I believe that it is.  There have been a few cases of call_rcu() being
invoked twice without a grace period between the two invocations.
Mathieu's patch would catch this sort of misbehavior.

That said, I do agree that if everyone followed the rules, there would
be no need for Mathieu's patch -- and there would be no need for much
else, besides.  ;-)

							Thanx, Paul

  reply	other threads:[~2010-03-19 22:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-19 20:47 [RFC patch 0/3] RCU head debug objects Mathieu Desnoyers
2010-03-19 20:47 ` [RFC patch 1/3] Debugobjects transition check Mathieu Desnoyers
2010-03-19 20:47 ` [RFC patch 2/3] tree/tiny rcu: Add debug RCU head objects (v3) Mathieu Desnoyers
2010-03-19 22:10   ` Alexey Dobriyan
2010-03-19 22:49     ` Paul E. McKenney [this message]
2010-03-22  3:33   ` Lai Jiangshan
2010-03-22 14:22     ` Mathieu Desnoyers
2010-03-19 20:47 ` [RFC patch 3/3] kernel call_rcu usage: initialize rcu_head structures Mathieu Desnoyers

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=20100319224932.GE2520@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=dvhltc@us.ibm.com \
    --cc=eric.dumazet@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@elte.hu \
    --cc=niv@us.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --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