From ee3b07766ba0d5598a0ec2abb9d27c3f5cae9744 Mon Sep 17 00:00:00 2001 From: "Theera K." Date: Tue, 24 Sep 2024 12:12:56 +0700 Subject: [PATCH] Evicting too many bytes from MFU metadata Without updating 'm' we evict from MFU metadata all that we wanted to evict from all metadata, including already evicted MRU metadata ('m' is the total amount of metadata we had at the beginning, and 'w' is the total amount of metadata we want to have). Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Signed-off-by: Theera K. Closes #16521 Closes #16546 --- 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 de64e7a5bd98..a4b81be0f0a1 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -4325,7 +4325,7 @@ arc_evict(void) /* Evict MFU metadata. */ w = wt * (int64_t)(arc_meta >> 16) >> 16; - e = MIN((int64_t)(asize - arc_c), (int64_t)(m - w)); + e = MIN((int64_t)(asize - arc_c), (int64_t)(m - bytes - w)); bytes = arc_evict_impl(arc_mfu, ARC_BUFC_METADATA, e); total_evicted += bytes; mfum -= bytes;