From: Andreas Dilger <adilger@clusterfs.com>
To: Bryan Henderson <hbryan@us.ibm.com>
Cc: Jan Hudec <bulb@ucw.cz>,
linux-fsdevel@vger.kernel.org,
Lustre Development Mailing List
<lustre-devel@lists.sourceforge.net>,
Richard Sharpe <rsharpe@richardsharpe.com>,
samba-technical@samba.org, Steven French <sfrench@us.ibm.com>
Subject: Re: fixing redundant network opens on Linux file creation
Date: Mon, 6 Jan 2003 15:48:53 -0700 [thread overview]
Message-ID: <20030106154853.N31555@schatzie.adilger.int> (raw)
In-Reply-To: <OFD6BDD187.10D74CF2-ON87256CA6.0079F557-88256CA6.007ABDEC@us.ibm.com>; from hbryan@us.ibm.com on Mon, Jan 06, 2003 at 02:23:01PM -0800
On Jan 06, 2003 14:23 -0800, Bryan Henderson wrote:
> >In our code, the lookup-with-intent actually performs both of the
> >operations on the server,
>
> What I don't get is why is the concept of "intent" even involved here? If
> lookup-with-intent does the lookup and open (and, I guess, create where
> appropriate), why don't you call it "lookup-and-open" and then skip the
> subsequent VFS open call?
Because the intent code is much more than just "lookup-and-open".
It is also lookup-and-create, lookup-and-mkdir, lookup-and-unlink,
lookup-and-setattr, etc. I don't think we want separate VFS ops for
every possible VFS op.
Also, in the Linux VFS, the lookup call is the one which is actually
doing the locking on the appropriate objects for atomicity purposes,
which is actually the critical thing here - we use lookup2 for doing
the distributed locking as much as for the RPC savings.
Like another Lustre developer remarked "it's a lock-with-intent on the
wire, and a lookup-with-intent in the kernel".
> You also mention the distributed version of the Lustre lookup-with-intent:
>
> >OR it returns a lock to the client that grants the client exclusive
> > control over the item(s) in question (normally the parent dir(s)) and
> > lets the client do the operations locally and send the operations to
> > the server separately.
>
> and the same question applies in that case. While the client may do the
> open separately, there's no reason it shouldn't do it before returning from
> the VFS lookup-with-intent call, which means it would be simpler as a
> lookup-and-open.
The reason we still do a VFS open call after we do the lookup-with-intent
are several:
1) like I said above, we don't want to have 2x every VFS op (one with
lookup and another without) either in our code or in the VFS proper
2) the amount of changes needed to the VFS would be quite large, if it had
to determine whether it should do a lookup-with-intent and no regular
op, or the lookup + regular op
3) doing lookup-with-intent allows us to manage the locking internal to
the filesystem however we want instead of having to live within the
VFS's ideas of locking (e.g. we could split up the locks within a
single directory so you could do concurrent creates/renames/unlinks
in a single directory if we so choose, and we may).
The thing to focus on here is that lookup2 is as much a locking API as
it is a lookup+operation API. I was thinking a clever name for it would
be "loockup", but that has some unfortunate connotations ;-).
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
next prev parent reply other threads:[~2003-01-06 22:48 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-06 17:25 fixing redundant network opens on Linux file creation Steven French
2003-01-06 18:14 ` Richard Sharpe
2003-01-06 17:59 ` Jan Hudec
2003-01-06 19:42 ` Bryan Henderson
2003-01-06 19:56 ` Jan Harkes
2003-01-06 21:58 ` Bryan Henderson
2003-01-06 21:31 ` Andreas Dilger
2003-01-06 22:23 ` Bryan Henderson
2003-01-06 22:48 ` Andreas Dilger [this message]
2003-01-07 1:06 ` Bryan Henderson
2003-01-07 13:19 ` [Lustre-devel] " Mike Shaver
2003-01-07 17:28 ` Bryan Henderson
2003-01-07 18:50 ` Andreas Dilger
2003-01-08 17:52 ` Bryan Henderson
2003-01-08 19:11 ` Peter Braam
2003-01-09 2:08 ` Bryan Henderson
2003-01-09 3:36 ` Peter Braam
2003-01-06 22:18 ` Marcos Dione
2003-01-07 9:35 ` Jan Hudec
-- strict thread matches above, loose matches on Subject: below --
2003-01-06 18:46 Steven French
2003-01-06 19:26 ` Richard Sharpe
2003-01-06 20:29 ` Richard Sharpe
2003-01-06 20:50 Steven French
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=20030106154853.N31555@schatzie.adilger.int \
--to=adilger@clusterfs.com \
--cc=bulb@ucw.cz \
--cc=hbryan@us.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=lustre-devel@lists.sourceforge.net \
--cc=rsharpe@richardsharpe.com \
--cc=samba-technical@samba.org \
--cc=sfrench@us.ibm.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).