]> Git Repo - linux.git/commitdiff
Merge tag 'vfs-6.11.inode' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
authorLinus Torvalds <[email protected]>
Mon, 15 Jul 2024 18:39:44 +0000 (11:39 -0700)
committerLinus Torvalds <[email protected]>
Mon, 15 Jul 2024 18:39:44 +0000 (11:39 -0700)
Pull vfs inode / dentry updates from Christian Brauner:
 "This contains smaller performance improvements to inodes and dentries:

  inode:

   - Add rcu based inode lookup variants.

     They avoid one inode hash lock acquire in the common case thereby
     significantly reducing contention. We already support RCU-based
     operations but didn't take advantage of them during inode
     insertion.

     Callers of iget_locked() get the improvement without any code
     changes. Callers that need a custom callback can switch to
     iget5_locked_rcu() as e.g., did btrfs.

     With 20 threads each walking a dedicated 1000 dirs * 1000 files
     directory tree to stat(2) on a 32 core + 24GB ram vm:

        before: 3.54s user 892.30s system 1966% cpu 45.549 total
        after:  3.28s user 738.66s system 1955% cpu 37.932 total (-16.7%)

     Long-term we should pick up the effort to introduce more
     fine-grained locking and possibly improve on the currently used
     hash implementation.

   - Start zeroing i_state in inode_init_always() instead of doing it in
     individual filesystems.

     This allows us to remove an unneeded lock acquire in new_inode()
     and not burden individual filesystems with this.

  dcache:

   - Move d_lockref out of the area used by RCU lookup to avoid
     cacheline ping poing because the embedded name is sharing a
     cacheline with d_lockref.

   - Fix dentry size on 32bit with CONFIG_SMP=y so it does actually end
     up with 128 bytes in total"

* tag 'vfs-6.11.inode' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
  fs: fix dentry size
  vfs: move d_lockref out of the area used by RCU lookup
  bcachefs: remove now spurious i_state initialization
  xfs: remove now spurious i_state initialization in xfs_inode_alloc
  vfs: partially sanitize i_state zeroing on inode creation
  xfs: preserve i_state around inode_init_always in xfs_reinit_inode
  btrfs: use iget5_locked_rcu
  vfs: add rcu-based find_inode variants for iget ops

1  2 
fs/bcachefs/fs.c
fs/btrfs/inode.c
fs/inode.c
fs/xfs/xfs_icache.c
include/linux/dcache.h
include/linux/fs.h

index fa1fee05cf8f571bff276a8bc1ad22f88c14da62,8122214e00a3888457499d6bc4340aec4662575d..0c7d1bc0548a4589ea1f503ee8e4d8298db79a3f
@@@ -241,10 -227,7 +241,9 @@@ static struct bch_inode_info *__bch2_ne
        mutex_init(&inode->ei_update_lock);
        two_state_lock_init(&inode->ei_pagecache_lock);
        INIT_LIST_HEAD(&inode->ei_vfs_inode_list);
 +      inode->ei_flags = 0;
        mutex_init(&inode->ei_quota_lock);
-       inode->v.i_state = 0;
 +      memset(&inode->ei_devs_need_flush, 0, sizeof(inode->ei_devs_need_flush));
  
        if (unlikely(inode_init_always(c->vfs_sb, &inode->v))) {
                kmem_cache_free(bch2_inode_cache, inode);
Simple merge
diff --cc fs/inode.c
Simple merge
Simple merge
Simple merge
Simple merge
This page took 0.165419 seconds and 4 git commands to generate.