From: Andrew Morton <akpm@osdl.org>
To: ASANO Masahiro <masano@tnes.nec.co.jp>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [RFC PATCH] add lookup hint for network file systems
Date: Fri, 23 Jun 2006 23:05:03 -0700 [thread overview]
Message-ID: <20060623230503.003c51af.akpm@osdl.org> (raw)
In-Reply-To: <20060623.210430.2110776701550307243.masano@tnes.nec.co.jp>
On Fri, 23 Jun 2006 21:04:30 +0900 (JST)
ASANO Masahiro <masano@tnes.nec.co.jp> wrote:
> Hi,
>
> I'm trying to speeding up mkdir(2) for network file systems.
> A typical mkdir(2) calls two inode_operations: lookup and mkdir.
> The lookup operation would fail with ENOENT in common case. I think
> it is unnecessary because the subsequent mkdir operation can check it.
> In case of creat(2), lookup operation is called with the LOOKUP_CREATE
> flag, so individual filesystem can omit real lookup. e.g. nfs_lookup().
>
> Here is a sample patch which uses LOOKUP_CREATE and O_EXCL on mkdir,
> symlink and mknod. This uses the gadget for creat(2).
>
> And here is the result of a benchmark on NFSv3.
> mkdir(2) 10,000 times:
> original 50.5 sec
> patched 29.0 sec
>
> Signed-off-by: ASANO Masahiro <masano@tnes.nec.co.jp>
>
> ---
>
> fs/namei.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> 5273ee304b4dc1096432dc3f3aa9183e20afab1d
> diff --git a/fs/namei.c b/fs/namei.c
> index 184fe4a..209867d 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -1759,6 +1759,8 @@ struct dentry *lookup_create(struct name
> if (nd->last_type != LAST_NORM)
> goto fail;
> nd->flags &= ~LOOKUP_PARENT;
> + nd->flags |= LOOKUP_CREATE;
> + nd->intent.open.flags = O_EXCL;
>
> /*
> * Do the final lookup.
whoa. Big patch ;)
I'll save it up for when Trond returns, thanks.
next prev parent reply other threads:[~2006-06-24 6:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-23 12:04 ASANO Masahiro
2006-06-24 6:05 ` Andrew Morton [this message]
2006-06-24 7:02 ` ASANO Masahiro
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=20060623230503.003c51af.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masano@tnes.nec.co.jp \
/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
all inboxes | Powered by JetHome®