mirror_zfs/module/os/freebsd/zfs
Alexander Motin 67ea51710a Several improvements to ARC shrinking (#16197)
- When receiving memory pressure signal from OS be more strict
trying to free some memory.  Otherwise kernel may come again and
request much more.  Return as result how much arc_c was actually
reduced due to this request, that may be less than requested.
 - On Linux when receiving direct reclaim from some file system
(that may be ZFS) instead of ignoring request completely, just
shrink the ARC, but do not wait for eviction.  Waiting there may
cause deadlock.  Ignoring it as before may put extra pressure on
other caches and/or swap, and cause OOM if nothing help.  While
not waiting may result in more ARC evicted later, and may be too
late if OOM killer activate right now, but I hope it to be better
than doing nothing at all.
 - On Linux set arc_no_grow before waiting for reclaim, not after,
or it may grow back while we are waiting.
 - On Linux add new parameter zfs_arc_shrinker_seeks to balance
ARC eviction cost, relative to page cache and other subsystems.
 - Slightly update Linux arc_set_sys_free() math for new kernels.

Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Reviewed-by: Rob Norris <rob.norris@klarasystems.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
2025-11-03 13:51:00 -08:00
..
abd_os.c abd_os: break out platform-specific header parts 2024-11-15 10:15:00 -08:00
arc_os.c Several improvements to ARC shrinking (#16197) 2025-11-03 13:51:00 -08:00
crypto_os.c freebsd: remove __FBSDID macro use 2024-11-18 11:44:05 -08:00
dmu_os.c freebsd: remove __FBSDID macro use 2024-11-18 11:44:05 -08:00
event_os.c FreeBSD: remove support for FreeBSD < 13.0-RELEASE (#16372) 2024-11-15 10:15:00 -08:00
hkdf.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
kmod_core.c freebsd: remove __FBSDID macro use 2024-11-18 11:44:05 -08:00
spa_os.c Fix build on FreeBSD 2023-03-22 09:24:41 -07:00
sysctl_os.c freebsd: remove __FBSDID macro use 2024-11-18 11:44:05 -08:00
vdev_file.c zfs_file: rename zfs_file_fallocate to zfs_file_deallocate 2024-11-15 10:15:00 -08:00
vdev_geom.c FreeBSD: remove support for FreeBSD < 13.0-RELEASE (#16372) 2024-11-15 10:15:00 -08:00
vdev_label_os.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_acl.c Fix an uninitialized data access (#16511) 2024-11-05 15:43:52 -08:00
zfs_ctldir.c FreeBSD: remove support for FreeBSD < 13.0-RELEASE (#16372) 2024-11-15 10:15:00 -08:00
zfs_debug.c zfs_debug: specific variant for userspace 2024-11-15 10:15:01 -08:00
zfs_dir.c FreeBSD: remove support for FreeBSD < 13.0-RELEASE (#16372) 2024-11-15 10:15:00 -08:00
zfs_file_os.c freebsd: remove __FBSDID macro use 2024-11-18 11:44:05 -08:00
zfs_ioctl_compat.c freebsd: remove __FBSDID macro use 2024-11-18 11:44:05 -08:00
zfs_ioctl_os.c freebsd: remove __FBSDID macro use 2024-11-18 11:44:05 -08:00
zfs_racct.c module: zfs: fix unused, remove argsused 2021-12-23 09:42:47 -08:00
zfs_vfsops.c FreeBSD: remove support for FreeBSD < 13.0-RELEASE (#16372) 2024-11-15 10:15:00 -08:00
zfs_vnops_os.c FreeBSD: remove support for FreeBSD < 13.0-RELEASE (#16372) 2024-11-15 10:15:00 -08:00
zfs_znode_os.c FreeBSD: restore zfs_znode_update_vfs() 2024-11-20 08:55:59 -08:00
zio_crypt.c Fix gcc uninitialized warning in FreeBSD zio_crypt.c 2024-11-06 10:06:29 -08:00
zvol_os.c FreeBSD: remove support for FreeBSD < 13.0-RELEASE (#16372) 2024-11-15 10:15:00 -08:00