linux/fs/notify
Amir Goldstein 082fd1ea1f fsnotify: optimize the case of no parent watcher
If parent inode is not watching, check for the event in masks of
sb/mount/inode masks early to optimize out most of the code in
__fsnotify_parent() and avoid calling fsnotify().

Jens has reported that this optimization improves BW and IOPS in an
io_uring benchmark by more than 10% and reduces perf reported CPU usage.

before:

+    4.51%  io_uring  [kernel.vmlinux]  [k] fsnotify
+    3.67%  io_uring  [kernel.vmlinux]  [k] __fsnotify_parent

after:

+    2.37%  io_uring  [kernel.vmlinux]  [k] __fsnotify_parent

Reported-and-tested-by: Jens Axboe <axboe@kernel.dk>
Link: https://lore.kernel.org/linux-fsdevel/b45bd8ff-5654-4e67-90a6-aad5e6759e0b@kernel.dk/
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Message-Id: <20240116113247.758848-1-amir73il@gmail.com>
2024-01-24 16:26:03 +01:00
..
dnotify fs: Remove the now superfluous sentinel elements from ctl_table array 2023-12-28 04:57:57 -08:00
fanotify sysctl-6.8-rc1 2024-01-10 17:44:36 -08:00
inotify fs: Remove the now superfluous sentinel elements from ctl_table array 2023-12-28 04:57:57 -08:00
fdinfo.c exportfs: add explicit flag to request non-decodeable file handles 2023-05-22 18:08:37 +02:00
fdinfo.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fsnotify.c fsnotify: optimize the case of no parent watcher 2024-01-24 16:26:03 +01:00
fsnotify.h fsnotify: remove unused declaration 2022-09-09 11:40:03 +02:00
group.c fsnotify: create helpers for group mark_mutex lock 2022-04-25 14:37:22 +02:00
Kconfig fs/notify: Remove "select SRCU" 2023-02-02 16:26:06 -08:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mark.c fanotify: store fsid in mark instead of in connector 2023-12-01 10:55:21 +01:00
notification.c fsnotify: Pass group argument to free_event 2021-10-27 12:34:18 +02:00