lkml.org 
[lkml]   [2010]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH tip/core/rcu 5/8] rcu: only one evaluation of arg in rcu_dereference_check() unless sparse
    On Thu, Sep 23, 2010 at 03:13:39PM +0200, Arnd Bergmann wrote:
    > 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>

    No problem, when you get me a better approach, I will happily queue it!

    Thanx, Paul


    \
     
     \ /
      Last update: 2010-09-27 20:09    [W:2.338 / U:0.336 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site