From 384b53be8e5c52a6c9d8f84fe1b198260e754f0e Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 1 Aug 2024 15:25:42 -0400 Subject: [PATCH] FreeBSD: Add missing memory reclamation accounting Signed-off-by: Alexander Motin Sponsored by: iXsystems, Inc. Reviewed-by: Tino Reichardt Reviewed-by: Umer Saleem Reviewed-by: Ameer Hamza Reviewed-by: Tony Hutter --- module/os/freebsd/zfs/arc_os.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/os/freebsd/zfs/arc_os.c b/module/os/freebsd/zfs/arc_os.c index 92696c0bf..94f0a6b9f 100644 --- a/module/os/freebsd/zfs/arc_os.c +++ b/module/os/freebsd/zfs/arc_os.c @@ -167,8 +167,12 @@ arc_lowmem(void *arg __unused, int howto __unused) * here from ARC itself and may hold ARC locks and thus risk a deadlock * with ARC reclaim thread. */ - if (curproc == pageproc) + if (curproc == pageproc) { arc_wait_for_eviction(to_free, B_FALSE); + ARCSTAT_BUMP(arcstat_memory_indirect_count); + } else { + ARCSTAT_BUMP(arcstat_memory_direct_count); + } } void