Re: [PATCH v2 1/4] dcache: Don't take unnecessary lock in d_count update

2013-04-05 Thread Waiman Long
On 04/05/2013 01:12 PM, Al Viro wrote: @@ -635,22 +640,14 @@ struct dentry *dget_parent(struct dentry *dentry) { struct dentry *ret; -repeat: - /* -* Don't need rcu_dereference because we re-check it was correct under -* the lock. -*/ rcu_read_lock

Re: [PATCH v2 1/4] dcache: Don't take unnecessary lock in d_count update

2013-04-05 Thread Al Viro
> @@ -635,22 +640,14 @@ struct dentry *dget_parent(struct dentry *dentry) > { > struct dentry *ret; > > -repeat: > - /* > - * Don't need rcu_dereference because we re-check it was correct under > - * the lock. > - */ > rcu_read_lock(); > - ret = dentry->d_paren

[PATCH v2 1/4] dcache: Don't take unnecessary lock in d_count update

2013-04-05 Thread Waiman Long
The current code takes the dentry's d_lock lock whenever the d_count reference count is being updated. In reality, nothing big really happens until d_count goes to 0 in dput(). So it is not necessary to take the lock if the reference count won't go to 0. Without using a lock, multiple threads may