From: Joel Becker <Joel.Becker@oracle.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Louis Rilling <Louis.Rilling@kerlabs.com>,
Arjan van de Ven <arjan@infradead.org>,
linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [RFC][PATCH 0/3] configfs: Make nested default groups lockdep-friendly
Date: Wed, 21 May 2008 15:09:43 -0700 [thread overview]
Message-ID: <20080521220943.GB25117@mail.oracle.com> (raw)
In-Reply-To: <1211367577.6463.91.camel@lappy.programming.kicks-ass.net>
On Wed, May 21, 2008 at 12:59:37PM +0200, Peter Zijlstra wrote:
> On Wed, 2008-05-21 at 12:25 +0200, Louis Rilling wrote:
> > Yes this could solve part of the issue, at the price of duplicating the
> > inode mutex class. However, this still does not solve the issue when
> > deleting config_groups, since in that case all nodes of the tree are
> > locked. Thinking about adding lockdep support for concurrent locking of
> > the direct children of a node in a tree...
>
> Why doesn't sysfs have this problem? - the code says configfs was
> derived from sysfs.
sysfs objects are created from kernel code. Things register
kobjects one at a time, so it has the usual parent->child dentry
relationships. This
is handled by I_MUTEX_PARENT/CHILD just fine.
configfs item creation is triggered from userspace. mkdir(2)
creates an item in a group. If that item is a group itself, it can have
child groups that automatically exist ("default_groups"). All of the
default_groups must appear before the userspace-invoked mkdir(2)
returns. Worse, rmdir(2) must happen atomically as well for these
default_groups (user-created children fail rmdir(2) with ENOTEMPTY as
expected). For safety, the entire tree under the group being removed
must be locked out. Hence the recursive locking of the default_group
subdirs.
> Also, do you really need to hold all locks when removing something?
> sound like a bit overdone. Also realise there is a maximum number of
> held locks - various people have already requested it to be increased or
> made dynamic. We're reluctant in doing so because we feel lock chains
> should not be of unlimited length. The deeper the chains the bigger the
> PI overhead etc..
Because we need to make sure that all default_group children
(and their default_group children, etc) are locked and safe to remove
from the dcache, we need to hold all of these locks. I haven't come up
with a safe way to do it atomically while rolling the locks up and down
the tree.
> As to modifying lockdep - it currently doesn't know about trees and
> teaching it about them isn't easy.
Yeah, it might not be practical. Hence Louis' most recent patch
to disable lockdep when we start walking one of these trees. But Arjan
is right that we shouldn't reject it out of hand - lockdep would be nice
here if we can find a way to make it work.
Joel
--
f/8 and be there.
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
WARNING: multiple messages have this Message-ID (diff)
From: Joel Becker <Joel.Becker@oracle.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Louis Rilling <Louis.Rilling@kerlabs.com>,
Arjan van de Ven <arjan@infradead.org>,
linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com
Subject: Re: [RFC][PATCH 0/3] configfs: Make nested default groups lockdep-friendly
Date: Wed, 21 May 2008 15:09:43 -0700 [thread overview]
Message-ID: <20080521220943.GB25117@mail.oracle.com> (raw)
In-Reply-To: <1211367577.6463.91.camel@lappy.programming.kicks-ass.net>
On Wed, May 21, 2008 at 12:59:37PM +0200, Peter Zijlstra wrote:
> On Wed, 2008-05-21 at 12:25 +0200, Louis Rilling wrote:
> > Yes this could solve part of the issue, at the price of duplicating the
> > inode mutex class. However, this still does not solve the issue when
> > deleting config_groups, since in that case all nodes of the tree are
> > locked. Thinking about adding lockdep support for concurrent locking of
> > the direct children of a node in a tree...
>
> Why doesn't sysfs have this problem? - the code says configfs was
> derived from sysfs.
sysfs objects are created from kernel code. Things register
kobjects one at a time, so it has the usual parent->child dentry
relationships. This
is handled by I_MUTEX_PARENT/CHILD just fine.
configfs item creation is triggered from userspace. mkdir(2)
creates an item in a group. If that item is a group itself, it can have
child groups that automatically exist ("default_groups"). All of the
default_groups must appear before the userspace-invoked mkdir(2)
returns. Worse, rmdir(2) must happen atomically as well for these
default_groups (user-created children fail rmdir(2) with ENOTEMPTY as
expected). For safety, the entire tree under the group being removed
must be locked out. Hence the recursive locking of the default_group
subdirs.
> Also, do you really need to hold all locks when removing something?
> sound like a bit overdone. Also realise there is a maximum number of
> held locks - various people have already requested it to be increased or
> made dynamic. We're reluctant in doing so because we feel lock chains
> should not be of unlimited length. The deeper the chains the bigger the
> PI overhead etc..
Because we need to make sure that all default_group children
(and their default_group children, etc) are locked and safe to remove
from the dcache, we need to hold all of these locks. I haven't come up
with a safe way to do it atomically while rolling the locks up and down
the tree.
> As to modifying lockdep - it currently doesn't know about trees and
> teaching it about them isn't easy.
Yeah, it might not be practical. Hence Louis' most recent patch
to disable lockdep when we start walking one of these trees. But Arjan
is right that we shouldn't reject it out of hand - lockdep would be nice
here if we can find a way to make it work.
Joel
--
f/8 and be there.
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127
next prev parent reply other threads:[~2008-05-21 22:09 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-20 16:33 [Ocfs2-devel] [RFC][PATCH 0/3] configfs: Make nested default groups lockdep-friendly Louis Rilling
2008-05-20 16:33 ` Louis Rilling
2008-05-20 16:33 ` [Ocfs2-devel] [RFC][PATCH 1/3] configfs: set CONFIGFS_USET_DEFAULT earlier in configfs_attach_group() Louis Rilling
2008-05-20 16:33 ` Louis Rilling
2008-05-20 16:33 ` [Ocfs2-devel] [RFC][PATCH 2/3] configfs: Silence lockdep when creating nested default groups Louis Rilling
2008-05-20 16:33 ` Louis Rilling
2008-05-20 16:33 ` [Ocfs2-devel] [RFC][PATCH 3/3] configfs: Silence lockdep when destroying " Louis Rilling
2008-05-20 16:33 ` Louis Rilling
2008-05-20 16:58 ` [RFC][PATCH 0/3] configfs: Make nested default groups lockdep-friendly Arjan van de Ven
2008-05-20 16:58 ` [Ocfs2-devel] " Arjan van de Ven
2008-05-20 17:08 ` Louis Rilling
2008-05-20 17:08 ` Louis Rilling
2008-05-20 21:56 ` [Ocfs2-devel] " Joel Becker
2008-05-20 21:56 ` Joel Becker
2008-05-20 22:13 ` Arjan van de Ven
2008-05-20 22:14 ` [Ocfs2-devel] " Arjan van de Ven
2008-05-20 22:27 ` Joel Becker
2008-05-20 22:27 ` Joel Becker
2008-05-20 22:35 ` Arjan van de Ven
2008-05-20 22:36 ` [Ocfs2-devel] " Arjan van de Ven
2008-05-20 23:51 ` Joel Becker
2008-05-20 23:51 ` Joel Becker
2008-05-21 9:20 ` [Ocfs2-devel] " Peter Zijlstra
2008-05-21 9:20 ` Peter Zijlstra
2008-05-21 9:23 ` [Ocfs2-devel] " Peter Zijlstra
2008-05-21 9:23 ` Peter Zijlstra
2008-05-21 10:25 ` [Ocfs2-devel] " Louis Rilling
2008-05-21 10:25 ` Louis Rilling
2008-05-21 10:59 ` [Ocfs2-devel] " Peter Zijlstra
2008-05-21 10:59 ` Peter Zijlstra
2008-05-21 12:54 ` [Ocfs2-devel] " Louis Rilling
2008-05-21 12:54 ` Louis Rilling
2008-05-21 22:09 ` Joel Becker [this message]
2008-05-21 22:09 ` Joel Becker
2008-05-21 8:13 ` [Ocfs2-devel] " Louis Rilling
2008-05-21 8:13 ` Louis Rilling
2008-05-20 21:41 ` [Ocfs2-devel] " Joel Becker
2008-05-20 21:41 ` Joel Becker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080521220943.GB25117@mail.oracle.com \
--to=joel.becker@oracle.com \
--cc=Louis.Rilling@kerlabs.com \
--cc=a.p.zijlstra@chello.nl \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.