All of lore.kernel.org
 help / color / mirror / Atom feed
* VFS pathname walking cleanups (i_op and ACL access)
@ 2011-07-22 17:37 Linus Torvalds
  2011-07-22 17:37 ` [PATCH 1/2] VFS: Cut down inode->i_op->xyz accesses in path walking Linus Torvalds
                   ` (2 more replies)
  0 siblings, 3 replies; 37+ messages in thread
From: Linus Torvalds @ 2011-07-22 17:37 UTC (permalink / raw)
  To: Al Viro, Christoph Hellwig, linux-fsdevel


I've got a branch named 'i_op-access-removal' which removes most (I think 
all) of the inode->i_op accesses from the normal RCU path resolution code 
for the common case. They did show up very clearly in profiles, even when 
the load is mostly cached - just the pointer chasing is expensive, 
especially since even cached loads aren't small enough to fit in L1.

The first patch is trivial, and just extends the DCACHE_OP_xyz flags in 
d_flags to also cover some of the core inode->i_op->xyz accesses that we 
don't need to *call* (either because they are NULL or because the results 
are cached), but we used to look things up.

The second patch moves the generic ACL caching case into the VFS layer the 
way it should have been done a long time ago (we already moved the cache 
fields into the core inode data structure), and just removes the need to 
call into the filesystem for 'check_acl()' for the common cached case.

I don't expect this to be really at all controversial, but doing this, I 
noticed that some of the ACL cache setup was a bit odd in filesystems. In 
the case of XFS, for example, the test for

	if (!XFS_IFORK_Q(ip))
		return -EAGAIN;

still remains in the filesystem-specific ACL check routine, which means 
that since it doesn't show up in the cache, that case is now going to kick 
XFS out of RCU. The fix seems to be trivial (just do a set_acl_cache() of 
NULL for that case), but I didn't want to go into locking issues, so I 
just added a comment.

Other filesystems should probably also check their ACL cache usage. Afaik, 
only for XFS did semantics *change* (because that XFS_IFORK_Q() used to be 
before the RCU check), but it looks to me like some filesystems aren't 
really doing the whole cache at all. Maybe they don't care, but it does 
mean that you won't get RCU walking on such a filesystem.

The two patches will come as follow-ons to this email.

                        Linus

---
Linus Torvalds (2):
  VFS: Cut down inode->i_op->xyz accesses in path walking
  vfs: move ACL cache lookup into generic code

 fs/9p/acl.c                |    3 -
 fs/afs/security.c          |    2 +-
 fs/btrfs/acl.c             |   19 +++------
 fs/btrfs/inode.c           |    7 +++-
 fs/ceph/inode.c            |    2 +-
 fs/cifs/cifsfs.c           |    2 +-
 fs/dcache.c                |    6 +++
 fs/ext2/acl.c              |    6 ---
 fs/ext3/acl.c              |    6 ---
 fs/ext4/acl.c              |    6 ---
 fs/fuse/dir.c              |    4 +-
 fs/gfs2/acl.c              |    6 ---
 fs/gfs2/inode.c            |    5 ++-
 fs/hostfs/hostfs_kern.c    |    2 +-
 fs/hpfs/namei.c            |    2 +-
 fs/jffs2/acl.c             |    3 -
 fs/jfs/acl.c               |    3 -
 fs/namei.c                 |   92 ++++++++++++++++++++++++++++++++-----------
 fs/nfs/dir.c               |    2 +-
 fs/nilfs2/inode.c          |    2 +-
 fs/ocfs2/acl.c             |    3 -
 fs/ocfs2/file.c            |    4 +-
 fs/proc/base.c             |    2 +-
 fs/reiserfs/xattr.c        |   17 +++-----
 fs/sysfs/inode.c           |    2 +-
 fs/xfs/linux-2.6/xfs_acl.c |    8 +---
 include/linux/dcache.h     |   12 ++++-
 include/linux/fs.h         |    3 +-
 28 files changed, 123 insertions(+), 108 deletions(-)

-- 
1.7.6.233.gd79bc.dirty


^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2011-08-07 23:43 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-22 17:37 VFS pathname walking cleanups (i_op and ACL access) Linus Torvalds
2011-07-22 17:37 ` [PATCH 1/2] VFS: Cut down inode->i_op->xyz accesses in path walking Linus Torvalds
2011-07-22 17:47   ` Christoph Hellwig
2011-07-22 23:40   ` Al Viro
2011-07-22 23:54     ` Linus Torvalds
2011-07-23  3:55   ` [PATCH] " Linus Torvalds
2011-07-23 13:35     ` Christoph Hellwig
2011-07-23 14:46       ` Al Viro
2011-07-23 14:51         ` Christoph Hellwig
2011-07-23 15:45         ` Linus Torvalds
     [not found]     ` <alpine.LFD.2.02.1107251852220.13796@i5.linux-foundation.org>
2011-07-26  3:05       ` Al Viro
2011-07-26  3:23         ` Linus Torvalds
2011-07-26 18:41           ` Al Viro
2011-07-26 18:45             ` Linus Torvalds
2011-08-07  6:06           ` Linus Torvalds
2011-08-07  6:51             ` Al Viro
2011-08-07 23:43               ` Linus Torvalds
2011-07-22 17:40 ` VFS pathname walking cleanups (i_op and ACL access) Christoph Hellwig
2011-07-22 17:45 ` [PATCH 2/2] vfs: move ACL cache lookup into generic code Linus Torvalds
2011-07-22 17:50   ` Christoph Hellwig
2011-07-22 17:54     ` Linus Torvalds
2011-07-23  2:34   ` [PATCH] " Linus Torvalds
2011-07-23  3:29     ` Al Viro
2011-07-23  3:42       ` Linus Torvalds
2011-07-23  4:31         ` Al Viro
2011-07-23  6:06           ` Al Viro
2011-07-25  8:15             ` Aneesh Kumar K.V
2011-07-25  8:16           ` Aneesh Kumar K.V
2011-07-23  7:47       ` Al Viro
2011-07-23 14:50         ` Christoph Hellwig
2011-07-23 15:32           ` Al Viro
2011-07-23 17:02             ` Al Viro
2011-07-23 17:31               ` Linus Torvalds
2011-07-23 18:20                 ` Al Viro
2011-07-23 18:29                   ` Linus Torvalds
2011-07-23 21:53                     ` Al Viro
2011-07-23 22:38                       ` Al Viro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.