HomeFreeBSD

Ignore zfs_arc_shrinker_limit in direct reclaim mode

Description

Ignore zfs_arc_shrinker_limit in direct reclaim mode

zfs_arc_shrinker_limit (default: 10000) avoids ARC collapse
due to excessive memory reclaim. However, when the kernel is
in direct reclaim mode (ie: low on memory), limiting ARC reclaim
increases OOM risk. This is especially true on system without
(or with inadequate) swap.

This patch ignores zfs_arc_shrinker_limit when the kernel is in
direct reclaim mode, avoiding most OOM. It also restores
"echo 3 > /proc/sys/vm/drop_caches" ability to correctly drop
(almost) all ARC.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Adam Moss <c@yotes.com>
Signed-off-by: Gionatan Danti <g.danti@assyoma.it>
Closes #16313

Details

Provenance
shodanshok <g.danti@assyoma.it>Authored on Aug 21 2024, 5:00 PM
GitHub <noreply@github.com>Committed on Aug 21 2024, 5:00 PM
Parents
rGa2c4e95cfdf6: linux/zvol_os.c: cleanup limits for non-blk mq case
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGbbe8512a93b0: Ignore zfs_arc_shrinker_limit in direct reclaim mode (authored by shodanshok <g.danti@assyoma.it>).Aug 21 2024, 5:00 PM