From d40d40913d33eb2d50cf363fa9f5022fc794cc9f 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 de64e7a5b..a4b81be0f 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;