From 098789216023bec08cd90b2a2ce9893611bbf790 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 d7ee9d32a75b..f40de4cb9ef7 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -4311,7 +4311,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;