[GIT PULL 05/12 for v7.1] vfs fs_struct
From: Christian Brauner
Date: Fri Apr 10 2026 - 11:26:07 EST
Hey Linus,
/* Summary */
Avoid excessive dput/dget in audit_context setup and reset paths When
the audit subsystem is enabled, it can do a lot of get_fs_pwd() calls to
get references to fs->pwd and then releasing those references back with
path_put() later. That may cause a lot of spinlock contention on a
single pwd's dentry lock because of the constant changes to the
reference count when there are many processes on the same working
directory actively doing open/close system calls. This can cause
noticeable performance regresssion when compared with the case where the
audit subsystem is turned off especially on systems with a lot of CPUs
which is becoming more common these days.
Avoid this type of performance regression caused by audit by adding a
new set of fs_struct helpers to reduce unncessary path_get() and
path_put() calls and the audit code is modified to use these new
helpers.
/* 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
================================
The following changes since commit 1f318b96cc84d7c2ab792fcc0bfd42a7ca890681:
Linux 7.0-rc3 (2026-03-08 16:56:54 -0700)
are available in the Git repository at:
git@xxxxxxxxxxxxxxxxxxx:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-7.1-rc1.fs_struct
for you to fetch changes up to 9eecc28ec595bfc0a8af3306b57f566027b3560c:
fs: factor out get_fs_pwd_pool_locked() for lock-held callers (2026-03-12 13:41:45 +0100)
----------------------------------------------------------------
vfs-7.1-rc1.fs_struct
Please consider pulling these changes from the signed vfs-7.1-rc1.fs_struct tag.
Thanks!
Christian
----------------------------------------------------------------
Christian Brauner (5):
Merge patch series "fs, audit: Avoid excessive dput/dget in audit_context setup and reset paths"
fs: use path_equal() in fs_struct helpers
fs: document seqlock usage in pwd pool APIs
fs: add drain_fs_pwd_pool() helper
fs: factor out get_fs_pwd_pool_locked() for lock-held callers
Waiman Long (2):
fs: Add a pool of extra fs->pwd references to fs_struct
audit: Use the new {get,put}_fs_pwd_pool() APIs to get/put pwd references
fs/fs_struct.c | 34 ++++++++++++++++++++++++++++------
fs/namespace.c | 10 ++++++++++
include/linux/fs_struct.h | 43 ++++++++++++++++++++++++++++++++++++++++++-
kernel/auditsc.c | 7 +++++--
4 files changed, 85 insertions(+), 9 deletions(-)