lkml.org 
[lkml]   [2010]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] NFS: Fix RCU warnings in nfs_inode_return_delegation_noreclaim() [ver #2]
On Tue, Apr 06, 2010 at 05:14:03PM +0100, David Howells wrote:
> Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
>
> > > > So you have objected to needless memory barriers. How do you feel
> > > > about possibly needless ACCESS_ONCE() calls?
> > >
> > > That would work here since it shouldn't emit any excess instructions.
> >
> > And here is the corresponding patch. Seem reasonable?
>
> Actually, now I've thought about it some more. No, it's not reasonable.
> You've written:
>
> This patch adds a variant of rcu_dereference() that handles situations
> where the RCU-protected data structure cannot change, perhaps due to
> our holding the update-side lock, or where the RCU-protected pointer is
> only to be tested, not dereferenced.
>
> But if we hold the update-side lock, then why should we be forced to use
> ACCESS_ONCE()?
>
> In fact, if we don't hold the lock, but we want to test the pointer twice in
> succession, why should we be required to use ACCESS_LOCK()?

OK, just to make sure I understand you... You are asking for two additional
RCU API members:

1. rcu_access_pointer() or some such that includes ACCESS_ONCE(),
but not smp_read_barrier_depends(), which may be used when
we are simply examining the value of the RCU-protected pointer
(as in the NFS case). It could also be used when the
appropriate update-side lock is held, but for that we have:

2. rcu_dereference_protected() or some such that includes neither
ACCESS_ONCE() nor smp_read_barrier_depends(), and that may
only be used if updates are prevented, for example, by holding
the appropriate update-side lock.

Does this fit?

Thanx, Paul


\
 
 \ /
  Last update: 2010-04-06 19:33    [W:0.184 / U:0.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site