linux/Documentation/admin-guide/sysctl
Yafang Shao e6957c99dc
vfs: Add a sysctl for automated deletion of dentry
Commit 681ce86235 ("vfs: Delete the associated dentry when deleting a
file") introduced an unconditional deletion of the associated dentry when a
file is removed. However, this led to performance regressions in specific
benchmarks, such as ilebench.sum_operations/s [0], prompting a revert in
commit 4a4be1ad3a ("Revert "vfs: Delete the associated dentry when
deleting a file"").

This patch seeks to reintroduce the concept conditionally, where the
associated dentry is deleted only when the user explicitly opts for it
during file removal. A new sysctl fs.automated_deletion_of_dentry is
added for this purpose. Its default value is set to 0.

There are practical use cases for this proactive dentry reclamation.
Besides the Elasticsearch use case mentioned in commit 681ce86235,
additional examples have surfaced in our production environment. For
instance, in video rendering services that continuously generate temporary
files, upload them to persistent storage servers, and then delete them, a
large number of negative dentries—serving no useful purpose—accumulate.
Users in such cases would benefit from proactively reclaiming these
negative dentries.

Link: https://lore.kernel.org/linux-fsdevel/202405291318.4dfbb352-oliver.sang@intel.com [0]
Link: https://lore.kernel.org/all/20240912-programm-umgibt-a1145fa73bb6@brauner/
Suggested-by: Christian Brauner <brauner@kernel.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Link: https://lore.kernel.org/r/20240929122831.92515-1-laoar.shao@gmail.com
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2024-10-22 11:16:57 +02:00
..
abi.rst docs: admin-guide: sysctl: avoid using ReST :doc:foo markup 2021-06-17 13:24:36 -06:00
fs.rst vfs: Add a sysctl for automated deletion of dentry 2024-10-22 11:16:57 +02:00
index.rst
kernel.rst parisc: Add support for CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN 2024-07-24 02:04:05 +02:00
net.rst ARC: Add eBPF JIT support 2024-05-12 16:51:36 -07:00
sunrpc.rst
user.rst time/namespace: Add max_time_namespaces ucount 2020-04-07 12:37:21 +02:00
vm.rst docs: mm: add enable_soft_offline sysctl 2024-07-04 18:06:00 -07:00