Skip to content

fs, audit: Avoid excessive dput/dget in audit_context setup and reset paths

Waiman Long audit linux-fsdevel lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 2 repliesIn review
  2. v3 posting 2/20 of 2 patches 0 repliesSuperseded
  3. v3 posting 1/22 patches 6 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v21 patch33 repliesSuperseded

Changes in v4 from the cover letter

- Add ack and review tags
- Simplify put_fs_pwd_pool() in patch 1 as suggested by Paul Moore

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2fs: Add a pool of extra fs->pwd references to fs_structfs/fs_struct.c fs/namespace.c include/linux/fs_struct.h+56 -60 replies
2/2audit: Use the new {get,put}_fs_pwd_pool() APIs to get/put pwd referenceskernel/auditsc.c+5 -20 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchRichard Guy BriggsPaul MooreWaiman Long
SeriesR-b
1/2R-b
2/2R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/2] fs, audit: Avoid excessive dput/dget in audit_context setup and reset paths

v4:
- Add ack and review tags
- Simplify put_fs_pwd_pool() in patch 1 as suggested by Paul Moore

v3:
- https://lore.kernel.org/lkml/[email protected]/

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 | 28 +++++++++++++++++++++++++++-
 kernel/auditsc.c          |  7 +++++--
 4 files changed, 61 insertions(+), 8 deletions(-)
Signature · 1 line
2.53.0