From: Jan Hudec <bulb@ucw.cz>
To: Richard Sharpe <rsharpe@richardsharpe.com>
Cc: Steven French <sfrench@us.ibm.com>,
samba-technical@samba.org, linux-fsdevel@vger.kernel.org
Subject: Re: fixing redundant network opens on Linux file creation
Date: Mon, 6 Jan 2003 18:59:58 +0100 [thread overview]
Message-ID: <20030106175958.GA632@vagabond> (raw)
In-Reply-To: <Pine.LNX.4.33.0301061011400.3030-100000@ns.aus.com>
On Mon, Jan 06, 2003 at 10:14:10AM -0800, Richard Sharpe wrote:
> On Mon, 6 Jan 2003, Steven French wrote:
>
> > The creat() system call results (for the Linux kernel) in calls to create
> > (via vfs_create) then later a call to open (via dentry_open) both of which
> > eventually end up (for the cifs vfs) doing a network open of the file from
> > the perspective of the CIFS protocol which degrades performance (because
> > every creat does one additional open & close than ideal). In the cifs
> > protocol file creation is handled as a flag on the open request so create
> > has a sideeffect of opening the file. Unfortunately since mknod can call
> > vfs_create (presumably without immediately afterwards calling open), it
> > seems like a vfs can't assume that all creates are necessarily going to be
> > immediately followed by a file open (server file handle leaks would be
> > possible if such an assumption were made). smbfs in effect ignores the
> > subsequent open and the nfs vfs doesn't have this problem because it
> > doesn't send a remote open request in nfs_open (since v2 and v3 nfs doesn't
> > really need an open file handle for file based operations like smb/cifs
> > does). To improve creat() performance for cifs (without changing namei.c
> > itself) it seems like there are only two obvious alternatives:
>
> Isn't creat() a legacy call? I have never used it, and use open(...,
> O_CREAT,...) instead.
>
> Isn't this just a cost of using legacy calls? Why complicate things overly
> for a call that might not be used all that much?
I am not sure, what it means "legacy call", but I am pretty sure, that
creat and open(... O_CREAT) end up calling exactly the same filesystem
methods with exactly the same parameters. (First lookup is called and it
does not know, what is to happen to the file, then create is called and
it does not know open mode for the file and last open is called with
apropriate mode).
> > 1) Have the cifs vfs ignore subsequent opens of the same file (never have
> > more than one open per inode - ala smbfs) - which has the disadvantage of
> > making the open flags (and pid) incorrect for subsequent opens and would
> > cause server problems with handling byte range locks and potentially causes
> > problems with other clients accessing a file that was just created via
> > mknod and therefore should not be considered open anymore.
> >
> > 2) Have the cifs vfs do "lazy close" of files - perhaps using the original
> > "opbatch" distributing caching mechanism in the smb/cifs protocol (which
> > cached opens for optimal performance running batch files on network drives)
> > for distributed cache management (so the client will not cause sharing
> > violations if other clients try to access the same file).
> >
> > I prefer the latter but am working on proving that it works now. Any
> > other approaches?
There is a lookup intent patch from lustre group. It can be found
somewhere in the archives. Pushing that (or something along that lines)
to mainline and using that would be IMHO most beneficial (because all
networking filesystems could benefit from this patch). However that does
not fall into the category "not changing namei.c".
-------------------------------------------------------------------------------
Jan 'Bulb' Hudec <bulb@ucw.cz>
next prev parent reply other threads:[~2003-01-06 17:59 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 [this message]
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
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=20030106175958.GA632@vagabond \
--to=bulb@ucw.cz \
--cc=linux-fsdevel@vger.kernel.org \
--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).