VFS pathname walking cleanups (i_op and ACL access)

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

 



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

--
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