Skip to content

Further reduce overhead of fsnotify permission hooks

Amir Goldstein linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10fsnotify: rename fsnotify_{get,put}_sb_connectors()fs/notify/fsnotify.c fs/notify/mark.c include/linux/fsnotify.h +1 more+45 -332 replies
2/10fsnotify: create helpers to get sb and connp from objectfs/notify/fsnotify.h fs/notify/mark.c+28 -03 replies
3/10fsnotify: create a wrapper fsnotify_find_inode_mark()fs/nfsd/filecache.c fs/notify/dnotify/dnotify.c fs/notify/inotify/inotify_user.c +3 more+14 -70 replies
4/10fanotify: merge two checks regarding add of ignore markfs/notify/fanotify/fanotify_user.c+17 -180 replies
5/10fsnotify: pass object pointer and type to fsnotify mark helpersfs/notify/fanotify/fanotify_user.c fs/notify/fsnotify.h fs/notify/mark.c +1 more+59 -1200 replies
6/10fsnotify: create helper fsnotify_update_sb_watchers()fs/notify/mark.c include/linux/fsnotify_backend.h+23 -140 replies
7/10fsnotify: lazy attach fsnotify_sb_info state to sbfs/notify/fsnotify.c fs/notify/fsnotify.h fs/notify/mark.c +2 more+73 -94 replies
8/10fsnotify: move s_fsnotify_connectors into fsnotify_sb_infoinclude/linux/fs.h include/linux/fsnotify.h include/linux/fsnotify_backend.h+13 -81 reply
9/10fsnotify: use an enum for group priority constantsfs/notify/fanotify/fanotify_user.c include/linux/fsnotify_backend.h+17 -140 replies
10/10fsnotify: optimize the case of no permission event watchersfs/notify/fsnotify.c fs/notify/mark.c include/linux/fsnotify.h +1 more+54 -90 replies

Reviews trailers per patch

1 of 10 patches has a Reviewed-by or Acked-by.

PatchChristian Brauner
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10R-b
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/10] Further reduce overhead of fsnotify permission hooks

Jan,

Commit 082fd1ea1f98 ("fsnotify: optimize the case of no parent watcher") has reduced the CPU overhead of fsnotify hooks, but we can further reduce the overhead of permission event hooks, by avoiding the call to fsnotify() and fsnotify_parent() altogether when there are no permission event watchers on the sb.

The main motivation for this work was to avoid the overhead that was reported by kernel test robot on the patch that adds the upcoming per-content event hooks (i.e. FS_PRE_ACCESS/FS_PRE_MODIFY).

Kernel test robot has confirmed that with this series, the addition of pre-conent fsnotify hooks does not result in any regression [1]. Kernet test robot has also reported performance improvements in some workloads compared to upstream on an earlier version of this series, but still waiting for the final results.

For now, as you requested, I am posting this series for review.

Thanks,
Amir.

[1] https://lore.kernel.org/all/Zc7KmlQ1cYVrPMQ+@xsang-OptiPlex-9020/
[2] https://lore.kernel.org/all/[email protected]/

Amir Goldstein (10):
fsnotify: rename fsnotify_{get,put}_sb_connectors()
fsnotify: create helpers to get sb and connp from object
fsnotify: create a wrapper fsnotify_find_inode_mark()
fanotify: merge two checks regarding add of ignore mark
fsnotify: pass object pointer and type to fsnotify mark helpers
fsnotify: create helper fsnotify_update_sb_watchers()
fsnotify: lazy attach fsnotify_sb_info state to sb
fsnotify: move s_fsnotify_connectors into fsnotify_sb_info
fsnotify: use an enum for group priority constants
fsnotify: optimize the case of no permission event watchers

 fs/nfsd/filecache.c                |   4 +-
 fs/notify/dnotify/dnotify.c        |   4 +-
 fs/notify/fanotify/fanotify_user.c | 141 +++++++----------------
 fs/notify/fsnotify.c               |  23 +++-
 fs/notify/fsnotify.h               |  38 +++++--
 fs/notify/inotify/inotify_user.c   |   2 +-
 fs/notify/mark.c                   | 173 ++++++++++++++++++++++-------
 include/linux/fs.h                 |  14 +--
 include/linux/fsnotify.h           |  21 +++-
 include/linux/fsnotify_backend.h   |  93 +++++++++++-----
 kernel/audit_tree.c                |   2 +-
 kernel/audit_watch.c               |   2 +-
 12 files changed, 314 insertions(+), 203 deletions(-)
Signature · 1 line
2.34.1