Re: [PATCH 5/6] IMA: use rbtree instead of radix tree for inode information cache

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

 



On Wed, 2010-10-20 at 15:22 -0700, Linus Torvalds wrote:
> On Wed, Oct 20, 2010 at 3:05 PM, Dave Chinner <david@xxxxxxxxxxxxx> wrote:
> >
> > /me wanders off to look at converting the xfs buffer cache rbtrees
> > to RCU....
> 
> Look out for livelocks, though. And yes, they can happen.
> 
> So rather than a loop, one option is to do basically
> 
>   rcu_read_lock();
>   seq = read_seqbegin();
> 
>   .. do lookup ..
> 
>   need_lock = read_seqretry(seq);
>   rcu_read_unlock();
> 
>   if (need_lock) {
>     get_real_lock();
> 
>     .. do lookup ..
> 
>     drop_real_lock();
>  }
> 
> which just falls back to a locked access if the rcu model doesn't work.
> 
>                              Linus

That is a really interesting alternative to traditional locking. Could
we perhaps document it in Documentation/rbtree.txt?

Cheers
   Trond

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


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux