Re: [PATCH 8/8] NFS: allow lockless access to access_cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mar 4, 2014, at 22:00, NeilBrown <neilb@xxxxxxx> wrote:

> The access cache is used during RCU-walk path lookups, so it is best
> to avoid locking if possible as taking a lock kills concurrency.
> 
> The rbtree is not rcu-safe and cannot easily be made so.
> Instead we simply check the last (i.e. most recent) entry on the LRU
> list.  If this doesn't match, then we return -ECHILD and retry in
> lock/refcount mode.
> 
> This requires freeing the nfs_access_entry struct with rcu, and
> requires using rcu access primates when adding entries to the lru, and
> when examining the last entry.
> 
> Calling put_rpccred before kfree_rcu looks a bit odd, but as
> put_rpccred already provide rcu protection, we know that the cred will
> not actually be freed until the next grace period, so any concurrent
> access will be safe.
> 
> This patch provides about 5% performance improvement on a stat-heavy
> synthetic work load with 4 threads on a 2-core CPU.
> 

Have you looked at converting the rb-tree into something a little more RCU-friendly? Since our lookup key is just a pointer value, couldn’t we use a radix-tree?

_________________________________
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.myklebust@xxxxxxxxxxxxxxx

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux