[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTikoPoV=OYjzX9+Rd5tWERS+n8sFejJuot7++ONP@mail.gmail.com>
Date: Wed, 20 Oct 2010 15:22:21 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Dave Chinner <david@...morbit.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Eric Paris <eparis@...hat.com>, linux-kernel@...r.kernel.org,
linux-security-module@...r.kernel.org,
linux-fsdevel@...r.kernel.org, hch@...radead.org, zohar@...ibm.com,
warthog9@...nel.org, jmorris@...ei.org, kyle@...artin.ca,
hpa@...or.com, akpm@...ux-foundation.org, mingo@...e.hu,
viro@...iv.linux.org.uk
Subject: Re: [PATCH 5/6] IMA: use rbtree instead of radix tree for inode
information cache
On Wed, Oct 20, 2010 at 3:05 PM, Dave Chinner <david@...morbit.com> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists