The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Christian Brauner <brauner@kernel.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [GIT PULL 03/16 for v7.2] vfs inode
Date: Fri, 12 Jun 2026 17:12:09 +0200	[thread overview]
Message-ID: <20260612-vfs-inode-v72-dde1140216e4@brauner> (raw)
In-Reply-To: <20260612-vfs-v72-20facee87e19@brauner>

Hey Linus,

/* Summary */

This extends the lockless ->i_count handling. iput() could already
decrement any value greater than 1 locklessly but acquiring a
reference always required taking inode->i_lock. Now acquiring a
reference is lockless as long as the count was already at least 1,
i.e., only the 0->1 and 1->0 transitions take the lock. This avoids
the lock for the common cases of nfs calling into the inode hash and
btrfs using igrab(). Cleanup-wise icount_read_once() is added to line
up with inode_state_read_once() and the open-coded ->i_count loads
across the tree are converted, and ihold() is relocated and tidied up.

On top of that some stale lock ordering annotations are retired from
the inode hash code: iunique() no longer takes the hash lock since the
inode hash became RCU-searchable and s_inode_list_lock is no longer
taken under the hash lock either.

/* Testing */

gcc (Debian 14.2.0-19) 14.2.0
Debian clang version 19.1.7 (3+b1)

No build failures or warnings were observed.

/* Conflicts */

Merge conflicts with mainline
=============================

No known conflicts.

Merge conflicts with other trees
================================

This has a merge conflict with the xfs tree in fs/xfs/xfs_trace.h
between commit 1113a6d6d5d133 ("xfs: remove the i_ino field in struct
xfs_inode") from the xfs tree and commit 769e143b115a4a ("fs: add
icount_read_once() and stop open-coding ->i_count loads") from this
tree, reported in [1]. It can be resolved as follows:

[1]: https://lore.kernel.org/linux-next/aigwDvQMI2CHiLl3@sirena.co.uk

diff --cc fs/xfs/xfs_trace.h
index ae5faa78783005,f87c738d84b248..00000000000000
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@@ -1157,8 -1157,8 +1157,8 @@@ DECLARE_EVENT_CLASS(xfs_iref_class
  	),
  	TP_fast_assign(
  		__entry->dev = VFS_I(ip)->i_sb->s_dev;
 -		__entry->ino = ip->i_ino;
 +		__entry->ino = I_INO(ip);
- 		__entry->count = icount_read(VFS_I(ip));
+ 		__entry->count = icount_read_once(VFS_I(ip));
  		__entry->pincount = atomic_read(&ip->i_pincount);
  		__entry->iflags = ip->i_flags;
  		__entry->caller_ip = caller_ip;

The following changes since commit 254f49634ee16a731174d2ae34bc50bd5f45e731:

  Linux 7.1-rc1 (2026-04-26 14:19:00 -0700)

are available in the Git repository at:

  git@gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-7.2-rc1.inode

for you to fetch changes up to 5b451b76c85c8309d2e02caa467b38f5999c986f:

  fs: retire stale lock ordering annotations from inode hash (2026-05-11 23:12:29 +0200)

----------------------------------------------------------------
vfs-7.2-rc1.inode

Please consider pulling these changes from the signed vfs-7.2-rc1.inode tag.

Thanks!
Christian

----------------------------------------------------------------
Christian Brauner (1):
      Merge patch series "assorted ->i_count changes + extension of lockless handling"

Mateusz Guzik (4):
      fs: add icount_read_once() and stop open-coding ->i_count loads
      fs: relocate and tidy up ihold()
      fs: allow lockless ->i_count bumps as long as it does not transition 0->1
      fs: retire stale lock ordering annotations from inode hash

 arch/powerpc/platforms/cell/spufs/file.c |   2 +-
 fs/btrfs/inode.c                         |   2 +-
 fs/ceph/mds_client.c                     |   2 +-
 fs/dcache.c                              |   4 ++
 fs/ext4/ialloc.c                         |   4 +-
 fs/hpfs/inode.c                          |   2 +-
 fs/inode.c                               | 100 +++++++++++++++++++++++++------
 fs/nfs/inode.c                           |   4 +-
 fs/smb/client/inode.c                    |   2 +-
 fs/ubifs/super.c                         |   2 +-
 fs/xfs/xfs_inode.c                       |   2 +-
 fs/xfs/xfs_trace.h                       |   2 +-
 include/linux/fs.h                       |  13 ++++
 include/trace/events/filelock.h          |   2 +-
 security/landlock/fs.c                   |   2 +-
 15 files changed, 112 insertions(+), 33 deletions(-)

  parent reply	other threads:[~2026-06-12 15:12 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-12 15:10 [GIT PULL 00/16 for v7.2] v7.2 Christian Brauner
2026-06-12 15:11 ` [GIT PULL 01/16 for v7.2] vfs kfunc Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:11 ` [GIT PULL 02/16 for v7.2] vfs exportfs Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:12 ` Christian Brauner [this message]
2026-06-15  3:45   ` [GIT PULL 03/16 for v7.2] vfs inode pr-tracker-bot
2026-06-12 15:12 ` [GIT PULL 04/16 for v7.2] vfs directory delegations Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:12 ` [GIT PULL 05/16 for v7.2] vfs casefold Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:13 ` [GIT PULL 06/16 for v7.2] kernel task_exec_state Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:13 ` [GIT PULL 07/16 for v7.2] kernel misc Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:13 ` [GIT PULL 08/16 for v7.2] vfs openat2 Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:14 ` [GIT PULL 09/16 for v7.2] vfs super Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:14 ` [GIT PULL 10/16 for v7.2] vfs writeback Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:14 ` [GIT PULL 11/16 for v7.2] vfs bh Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:15 ` [GIT PULL 12/16 for v7.2] vfs eventpoll Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:15 ` [GIT PULL 13/16 for v7.2] vfs iomap Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:15 ` [GIT PULL 14/16 for v7.2] vfs xattr Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:16 ` [GIT PULL 15/16 for v7.2] vfs misc Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:16 ` [GIT PULL 16/16 for v7.2] vfs procfs Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260612-vfs-inode-v72-dde1140216e4@brauner \
    --to=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox