From 41baa89be6e7bcdd3607dc875102eda0f7078f72 Mon Sep 17 00:00:00 2001 From: Gionatan Danti Date: Thu, 27 Oct 2022 06:20:17 -0400 Subject: [PATCH] Reclaim metadata when arc_available_memory < 0 even if meta_used is not bigger than arc_meta_limit As described in https://github.com/openzfs/zfs/issues/14054 if zfs_arc_meta_limit_percent=100 then ARC target can collapse to arc_min due to arc_purge not freeing any metadata. This patch lets arc_prune to do its work when arc_available_memory is negative even if meta_used is not bigger than arc_meta_limit, avoiding ARC target collapse. Signed-off-by: Gionatan Danti --- module/zfs/arc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 54cfb4bd3d04..435beddfeccd 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -4469,7 +4469,7 @@ arc_evict_meta_balanced(uint64_t meta_used) * meta buffers. Requests to the upper layers will be made with * increasingly large scan sizes until the ARC is below the limit. */ - if (meta_used > arc_meta_limit) { + if (meta_used > arc_meta_limit || arc_available_memory() < 0) { if (type == ARC_BUFC_DATA) { type = ARC_BUFC_METADATA; } else {