From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] Re: [PATCH] configfs: Silence lockdep on mkdir(), rmdir() and configfs_depend_item()
Date: Thu, 18 Dec 2008 11:26:58 +0000 [thread overview]
Message-ID: <1229599618.3538.21.camel@localhost.localdomain> (raw)
In-Reply-To: <20081218092744.GB30789@mail.oracle.com>
Hi,
I have to say that when I brought this subject up, I didn't realise
quite how tricky this was going to be, however...
On Thu, 2008-12-18 at 01:27 -0800, Joel Becker wrote:
> On Thu, Dec 18, 2008 at 08:26:48AM +0100, Peter Zijlstra wrote:
> > On Wed, 2008-12-17 at 13:40 -0800, Andrew Morton wrote:
> > > On Fri, 12 Dec 2008 16:29:11 +0100
> > > Louis Rilling <louis.rilling@kerlabs.com> wrote:
> > > > >From inside configfs it is not possible to serialize those recursive
> > > > locking with a top-level one, because mkdir() and rmdir() are already
> > > > called with inodes locked by the VFS. So using some
> > > > mutex_lock_nest_lock() is not an option.
>
> <snip>
>
<more snipping>
> > Right, so basically we avoid syscalls by making vfs ops do stuff..
> > lovely - still not seeing it though - regular filesystems seems to cope
> > just fine and they get to create arbitrary tree structures too.
>
> It's about the default_groups and how they build up and tear
> down small bits of tree.
> A simple creation of a config_item, a mkdir(2), is a normal VFS
> lock set and doesn't make lockdep unhappy. But if the new config_item
> has a default_group or two, they need locking too. Not so much on
> mkdir(2), but on rmdir(2).
>
So if I've understood this correctly, the dentries created upon mkdir
live until such time as they are removed at some later date, presumably
with rmdir?
When creating the tree, would it be possible to build it starting from
the bottom and working towards the point of attachment and then to not
actually attach it until the last moment? That way it would not be
visible from userland until it was linked into the existing dir and that
solves the locking issue for mkdir I think.
As you say, rmdir seems the harder problem, but again, is it possible to
separate the unlink operation from the destruction of the tree by
keeping the tree, after its been unlinked, until the last userland
reference has gone away? At least I assume that is why the locking is
there. I may be a bit off the mark, but it seems like this is quite
similar to how the VFS does umount, so maybe there are some hints in
that code which may help us solve this issue?
Steve.
next prev parent reply other threads:[~2008-12-18 11:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20081212100615.GD19128@hawkmoon.kerlabs.com>
[not found] ` <1229095751-23984-1-git-send-email-louis.rilling@kerlabs.com>
2008-12-17 21:40 ` [Cluster-devel] Re: [PATCH] configfs: Silence lockdep on mkdir(), rmdir() and configfs_depend_item() Andrew Morton
2008-12-17 22:03 ` Joel Becker
2008-12-17 22:09 ` Andrew Morton
[not found] ` <1229585208.9487.112.camel@twins>
2008-12-18 9:27 ` Joel Becker
2008-12-18 11:26 ` Steven Whitehouse [this message]
[not found] ` <1229601399.9487.218.camel@twins>
[not found] ` <1229603308.9487.227.camel@twins>
2008-12-18 22:58 ` Joel Becker
[not found] ` <1232973009.4863.76.camel@laptop>
[not found] ` <20090126132453.GD7532@hawkmoon.kerlabs.com>
[not found] ` <1232977283.4863.79.camel@laptop>
[not found] ` <20090126140032.GE7532@hawkmoon.kerlabs.com>
[not found] ` <1232979562.4863.101.camel@laptop>
[not found] ` <20090126145536.GG7532@hawkmoon.kerlabs.com>
2009-01-28 3:05 ` Joel Becker
2009-01-28 3: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=1229599618.3538.21.camel@localhost.localdomain \
--to=swhiteho@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).