From: Waiman Long <longman@redhat.com>
To: Paul Moore <paul@paul-moore.com>, Eric Paris <eparis@redhat.com>,
Christian Brauner <brauner@kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, audit@vger.kernel.org,
Richard Guy Briggs <rgb@redhat.com>,
Ricardo Robaina <rrobaina@redhat.com>,
Waiman Long <longman@redhat.com>
Subject: [PATCH v3 0/2] fs, audit: Avoid excessive dput/dget in audit_context setup and reset paths
Date: Fri, 6 Feb 2026 15:19:15 -0500 [thread overview]
Message-ID: <20260206201918.1988344-1-longman@redhat.com> (raw)
v3:
- Add a new counter in fs_struct to track # of additional references
to pwd and add a new get_fs_pwd_pool() and put_fs_pwd_pool helpers
to use the new counter.
- Make audit use the new helpers instead of storing pwd reference
internally.
v2: https://lore.kernel.org/lkml/20260203194433.1738162-1-longman@redhat.com/
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.
This patch series aim to 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.
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 | 26 +++++++++++++++++++++-----
fs/namespace.c | 8 ++++++++
include/linux/fs_struct.h | 30 +++++++++++++++++++++++++++++-
kernel/auditsc.c | 7 +++++--
4 files changed, 63 insertions(+), 8 deletions(-)
--
2.52.0
next reply other threads:[~2026-02-06 20:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-06 20:19 Waiman Long [this message]
2026-02-06 20:19 ` [PATCH v3 1/2] fs: Add a pool of extra fs->pwd references to fs_struct Waiman Long
2026-02-27 16:37 ` Richard Guy Briggs
2026-02-06 20:19 ` [PATCH v3 2/2] audit: Use the new {get,put}_fs_pwd_pool() APIs to get/put pwd references Waiman Long
2026-02-27 16:37 ` Richard Guy Briggs
2026-02-12 16:36 ` [PATCH v3 0/2] fs, audit: Avoid excessive dput/dget in audit_context setup and reset paths Ricardo Robaina
2026-02-12 18:08 ` [RESEND PATCH " Waiman Long
2026-02-12 18:08 ` [RESEND PATCH v3 1/2] fs: Add a pool of extra fs->pwd references to fs_struct Waiman Long
2026-02-19 22:20 ` Paul Moore
2026-02-28 18:42 ` Waiman Long
2026-02-12 18:08 ` [RESEND PATCH v3 2/2] audit: Use the new {get,put}_fs_pwd_pool() APIs to get/put pwd references Waiman Long
2026-02-19 22:14 ` Paul Moore
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=20260206201918.1988344-1-longman@redhat.com \
--to=longman@redhat.com \
--cc=audit@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=eparis@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=rgb@redhat.com \
--cc=rrobaina@redhat.com \
--cc=viro@zeniv.linux.org.uk \
/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