mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
linux/super: add tunable to request immediate reclaim of unused inodes
Traditionally, unused inodes would be held on the superblock inode cache until the associated on-disk file is removed or the kernel requests reclaim. On filesystems with millions of rarely-used files, this can be a lot of unusable memory. Here we implement the superblock drop_inode method, and add a zfs_delete_inode tunable to control its behaviour. By default it continues the traditional behaviour, but when the tunable is enabled, we signal that the inode should be deleted immediately when the last reference is dropped, rather than cached. This releases the associated data to the dbuf cache and ARC, allowing them to be reclaimed normally. Sponsored-by: Klara, Inc. Sponsored-by: Fastmail Pty Ltd Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Rob Norris <rob.norris@klarasystems.com> Closes #17746
This commit is contained in:
committed by
Brian Behlendorf
parent
ffe93aee0a
commit
ab93b4b70e
+22
-1
@@ -18,7 +18,7 @@
|
||||
.\" own identifying information:
|
||||
.\" Portions Copyright [yyyy] [name of copyright owner]
|
||||
.\"
|
||||
.Dd August 14, 2025
|
||||
.Dd September 15, 2025
|
||||
.Dt ZFS 4
|
||||
.Os
|
||||
.
|
||||
@@ -2583,6 +2583,27 @@ the xattr so as to not accumulate duplicates.
|
||||
.It Sy zio_requeue_io_start_cut_in_line Ns = Ns Sy 0 Ns | Ns 1 Pq int
|
||||
Prioritize requeued I/O.
|
||||
.
|
||||
.It Sy zfs_delete_inode Ns = Ns Sy 0 Ns | Ns 1 Pq int
|
||||
Sets whether the kernel should free an inode structure when the last reference
|
||||
is released, or cache it in memory.
|
||||
Intended for testing/debugging.
|
||||
.Pp
|
||||
A live inode structure "pins" versious internal OpenZFS structures in memory,
|
||||
which can result in large amounts of "unusable" memory on systems with lots of
|
||||
infrequently-accessed files, until the kernel's memory pressure mechanism
|
||||
asks OpenZFS to release them.
|
||||
.Pp
|
||||
The default value of
|
||||
.Sy 0
|
||||
always caches inodes that appear to still exist on disk.
|
||||
Setting it to
|
||||
.Sy 1
|
||||
will immediately release unused inodes and their associated memory back to the
|
||||
dbuf cache or the ARC for reuse, but may reduce performance if inodes are
|
||||
frequently evicted and reloaded.
|
||||
.Pp
|
||||
This parameter is only available on Linux.
|
||||
.
|
||||
.It Sy zio_taskq_batch_pct Ns = Ns Sy 80 Ns % Pq uint
|
||||
Percentage of online CPUs which will run a worker thread for I/O.
|
||||
These workers are responsible for I/O work such as compression, encryption,
|
||||
|
||||
Reference in New Issue
Block a user