Re: [PATCH] vfs: remove the unnecessrary code of fs/inode.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/02/2013 12:41 AM, Al Viro wrote:
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.


that's right, i didn't think of it, but i think may be we can remove
the deduplicate codes of iget_lock() and iget5_lock() function, right?

if ok, i will send a new patch later. :)

thx Viro.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux