lkml.org 
[lkml]   [2012]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/9] blkcg: drop unnecessary RCU locking
Hey, Vivek.

On Fri, Feb 17, 2012 at 11:19:58AM -0500, Vivek Goyal wrote:
> On Thu, Feb 16, 2012 at 02:37:51PM -0800, Tejun Heo wrote:
> > Now that blkg additions / removals are always done under both q and
> > blkcg locks, the only place RCU locking is used is blkg_lookup() for
> > lockless lookup. This patch drops unncessary RCU locking replacing it
> > with plain blkcg / q locking as necessary.
> >
> > * blkg_lookup_create() and blkiocg_pre_destroy() already perform
> > proper locking and don't need RCU. Dropped.
>
> But blkg_lookup_create() is called under rcu() to protect blkcg pointer.
> And blkg_lookup() is also happening under same rcu read lock. So I think
> you can't drop rcu from blkg_lookup_create().

Ooh, right. Will fix.

> > {
> > struct blkio_group *blkg, *new_blkg;
> >
> > - WARN_ON_ONCE(!rcu_read_lock_held());
>
> Don't we want to be called with rcu lock held needed for blkg_lookup()?

We want WARN_ON_ONCE(none of RCU, blkcg and queue lock held). We can
do it using lockdep macros inside #ifdef CONFIG_LOCKDEP. It's just a
bit clunky.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2012-02-17 18:09    [W:0.068 / U:0.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site