From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH] VFS: Cut down inode->i_op->xyz accesses in path walking Date: Sat, 23 Jul 2011 15:35:34 +0200 Message-ID: <20110723133534.GA8644@lst.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Al Viro , Christoph Hellwig , linux-fsdevel To: Linus Torvalds Return-path: Received: from verein.lst.de ([213.95.11.211]:43269 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752516Ab1GWNff (ORCPT ); Sat, 23 Jul 2011 09:35:35 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Jul 22, 2011 at 08:55:48PM -0700, Linus Torvalds wrote: > If something sets dentry->d_inode without going through __d_instantiate, > that misses it. I'm looking at d_obtain_alias(), and wondering, for > example. As pointed out in my last mail d_obtain_alias will absolute need setting up these flags as well. > This is a very minimal version of the previous patch: those *two* places > where we now test the new DCACHE_OP_xyz bits are where we really see the > dereferencing of the inode->i_op in the normal path walking. HOWEVER, the > "inode_permission()" function also shows up pretty clearly on profiles, > and the hottest part of that is the testing of "inode->i_op->permission". > > However, with Al's other changes, the old special-case "exec_permission()" > no longer exists. The whole reason it existed before was that the execute > permission checking on directory entries is/was special from a performance > standpoint. So it might make sense to resurrect it, and then add the > DCACHE_OP_PERMISSION case like in my older patch. I don't think we need to re-add exec_permission for it. By checking DCACHE_OP_PERMISSION instead of inode->i_op->permission you'll always got directly to generic_permission in inode_permission, and in there acl_permission_check -> check_acl should simply do the right thing with your your patch to take the ACL cache checking into common code.