lkml.org 
[lkml]   [2010]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] NFS: Fix RCU warnings in nfs_inode_return_delegation_noreclaim() [ver #2]
Date
Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:

> > > if (rcu_dereference_check(nfsi->delegation,
> > > lockdep_is_held(&clp->cl_lock)) != NULL) {
> >
> > If clp->cl_lock protects this pointer, why the need for
> > rcu_dereference_check() at all? The check is redundant since the line
> > above gets the very lock we're checking for.
>
> Because Arnd Bergmann is working on a set of patches that makes sparse
> complain if you access an RCU-protected pointer directly, without using
> some flavor of rcu_dereference().
>
> So your approach would work for the moment, but would need another
> change, probably in the 2.6.35 timeframe.

My objection to using rcu_dereference_check() here is that it's a dynamic
check: the compiler emits code to do it, since the lock/unlock status of what
the pointer points to cannot be determined easily at compiler time - and then
the barrier is interpolated anyway unnecessarily.

David


\
 
 \ /
  Last update: 2010-03-29 22:19    [W:1.451 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site