lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 02 Jul 2013 02:11:34 -0400
From:	Dong Fang <yp.fangdong@...il.com>
To:	Al Viro <viro@...IV.linux.org.uk>
CC:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] vfs: remove the unnecessrary code of fs/inode.c

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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ