Re: Q. locking order of dcache_lru_lock

Dave Chinner
2011-04-11T06:27:11Z

On Mon, Apr 11, 2011 at 02:09:31PM +0900, J. R. Okajima wrote:
>
> Peter Zijlstra:
> > On Fri, 2011-04-08 at 22:20 +0900, J. R. Okajima wrote:
> > >=20
> > > When spin_trylock(&dentry->d_lock) successfully acquired d_lock, does
> > > the violation of locking order happen (or a deadlock, in worse case)?=20
> >
> > No, since a trylock never actually blocks a deadlock cannot occur.
>
> Ah, exactly. I had to be sleeping when I wrote about deadlock.
> How about the locking order? Do you think d_lock after dcache_lru_lock
> is a problem?

>From fs/dcache.c:

* Ordering:
* dentry->d_inode->i_lock
* dentry->d_lock
* dcache_lru_lock
* dcache_hash_bucket lock
* s_anon lock

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com