From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/gfs-kernel/src/gfs inode.h ops_export.c
Date: Thu, 18 Jan 2007 09:56:59 +0000 [thread overview]
Message-ID: <1169114219.3209.7.camel@localhost.localdomain> (raw)
In-Reply-To: <45AEABA1.2010408@redhat.com>
Hi,
On Wed, 2007-01-17 at 18:05 -0500, Wendy Cheng wrote:
> Steven Whitehouse wrote:
> > Hi,
> >
> > Just wondering why this:
> >
> > On Tue, 2007-01-16 at 20:39 +0000, wcheng at sourceware.org wrote:
> > [snip]
> >> -
> >> error = gfs_glock_nq_num(sdp,
> >> - inum.no_formal_ino, &gfs_inode_glops,
> >> + inum->no_formal_ino, &gfs_inode_glops,
> >> LM_ST_SHARED, LM_FLAG_ANY | GL_LOCAL_EXCL,
> >> &i_gh);
> >>
> > needs the GL_LOCAL_EXCL flag. I would have thought an ordinary shared
> > lock would be enough?
> >
> It is required to prevent (by serializing) other process (on the same
> node) to create this gfs inode at the same time (equivalence of an
> semaphore or mutex). Lookup (and several other GFS1 mount/umount) code
> needs this flag too. This (my guess) is to reduce the need to create
> another set of semaphores/mutex. In summary, I think it has two advantages:
> 1. Less locks
> 2. Easier to track who owns what (since glock holder is easy to find
> when compared with sempahore/mutex).
>
Ah, that kind of makes sense then for gfs1.
> The down-side is that it makes glock code difficult to understand. For
> GFS1, let's keep it this way. For GFS2, your call :) ...
>
Yes, I don't want to go changing things like that in GFS1 at all :-) In
GFS2 we use the inode cache as its supposed to be used and that deals
with all the required local serialisation, so it looks to be redundant
in that case.
Also in more recent kernels, lockdep deals with your point #2 above, so
I can't see anything really standing in the way of swapping the few
remaining cases for a mutex or rwsem and glock combination.
In fact one of the reason for doing this is to work towards the
possibility of using lockdep with glocks. Lockdep has no concept of
"local" and "remote" but it does have the concept of nested locks so its
one step closer to being able to make use of that,
Steve.
next prev parent reply other threads:[~2007-01-18 9:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-16 20:39 [Cluster-devel] cluster/gfs-kernel/src/gfs inode.h ops_export.c wcheng
2007-01-17 14:12 ` Steven Whitehouse
2007-01-17 23:05 ` Wendy Cheng
2007-01-18 9:56 ` Steven Whitehouse [this message]
2007-01-18 15:17 ` Steven Whitehouse
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=1169114219.3209.7.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).