From: Arnd Bergmann <arnd@arndb.de>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu,
laijs@cn.fujitsu.com, dipankar@in.ibm.com,
akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca,
josh@joshtriplett.org, 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: [PATCH tip/core/rcu 5/8] rcu: only one evaluation of arg in rcu_dereference_check() unless sparse
Date: Thu, 23 Sep 2010 15:13:39 +0200 [thread overview]
Message-ID: <201009231513.40126.arnd@arndb.de> (raw)
In-Reply-To: <1285203053-22068-5-git-send-email-paulmck@linux.vnet.ibm.com>
On Thursday 23 September 2010, Paul E. McKenney wrote:
> The current version of the __rcu_access_pointer(), __rcu_dereference_check(),
> and __rcu_dereference_protected() macros evaluate their "p" argument
> three times, not counting typeof()s. This is bad news if that argument
> contains a side effect. This commit therefore evaluates this argument
> only once in normal kernel builds. However, the straightforward approach
> defeats sparse's RCU-pointer checking, so when __CHECKER__ is defined,
> the additional pair of evaluations of the "p" argument are performed in
> order to permit sparse to detect misuse of RCU-protected pointers.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
Sorry for not following up with the alternative approach yet. We can always
do that later, for your patch should go into 2.6.36 to fix any problems
arising from unintended macro side-effects.
Acked-by: Arnd Bergmann <arnd@arndb.de>
next prev parent reply other threads:[~2010-09-23 13:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-23 0:50 [PATCH tip/core/rcu 0/8] random RCU fixes and updates Paul E. McKenney
2010-09-23 0:50 ` [PATCH tip/core/rcu 1/8] rcu: upgrade stallwarn.txt documentation for CPU-bound RT processes Paul E. McKenney
2010-09-23 0:50 ` [PATCH tip/core/rcu 2/8] rcu: performance fixes to TINY_PREEMPT_RCU callback checking Paul E. McKenney
2010-09-23 0:50 ` [PATCH tip/core/rcu 3/8] rcu: fix _oddness handling of verbose stall warnings Paul E. McKenney
2010-09-23 0:50 ` [PATCH tip/core/rcu 4/8] kernel: Removing undead ifdef CONFIG_DEBUG_LOCK_ALLOC Paul E. McKenney
2010-09-23 0:50 ` [PATCH tip/core/rcu 5/8] rcu: only one evaluation of arg in rcu_dereference_check() unless sparse Paul E. McKenney
2010-09-23 13:13 ` Arnd Bergmann [this message]
2010-09-23 17:23 ` Paul E. McKenney
2010-09-23 0:50 ` [PATCH tip/core/rcu 6/8] rcu: fix sparse errors in rcutorture.c Paul E. McKenney
2010-09-23 0:50 ` [PATCH tip/core/rcu 7/8] rcu: Add tracing data to support queueing models Paul E. McKenney
2010-09-23 0:50 ` [PATCH tip/core/rcu 8/8] rcu: Add advice to PROVE_RCU_REPEATEDLY kernel config parameter Paul E. McKenney
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=201009231513.40126.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=Valdis.Kletnieks@vt.edu \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=dipankar@in.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@polymtl.ca \
--cc=mingo@elte.hu \
--cc=niv@us.ibm.com \
--cc=paulmck@linux.vnet.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