From: Al Viro <viro@ZenIV.linux.org.uk>
To: Dong Fang <yp.fangdong@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vfs: remove the unnecessrary code of fs/inode.c
Date: Tue, 2 Jul 2013 05:41:22 +0100 [thread overview]
Message-ID: <20130702044122.GJ4165@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1372681143-23465-1-git-send-email-yp.fangdong@gmail.com>
On Mon, Jul 01, 2013 at 08:19:03AM -0400, Dong Fang wrote:
> These functions, such as find_inode_fast() and find_inode(), iget_lock() and
> iget5_lock(), insert_inode_locked() and insert_inode_locked4(), almost have
> the same code.
NAK. These functions exist exactly because the variant with callbacks
costs more. We walk the hash chain and for each inode on it your
variant would result in
* call
* fetching ino from memory
* comparison (and storing result in general-purpose register)
* return
* checking that register and branch on the result of that check
What's more, the whole thing's not fun for branch predictor.
It is a hot enough path to warrant a special-cased variant; if we can't
get away with that, we use the variants with callbacks, but on filesystems
where ->i_ino is sufficient as search key we really want to avoid the
overhead.
next prev parent reply other threads:[~2013-07-02 4:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-01 12:19 [PATCH] vfs: remove the unnecessrary code of fs/inode.c Dong Fang
2013-07-02 4:15 ` Gu Zheng
2013-07-02 6:00 ` Dong Fang
2013-07-02 4:41 ` Al Viro [this message]
2013-07-02 6:11 ` Dong Fang
2013-07-02 6:22 ` Dong Fang
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=20130702044122.GJ4165@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yp.fangdong@gmail.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