From 20c8bdd85ef4716d5e59d9f6f61347c0e4566750 Mon Sep 17 00:00:00 2001 From: bnovkov <72801811+bnovkov@users.noreply.github.com> Date: Fri, 7 Jun 2024 03:11:00 +0200 Subject: [PATCH] FreeBSD: Update use of UMA-related symbols in arc_available_memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Recent UMA changes repurposed the use of UMA_MD_SMALL_ALLOC in a way that breaks arc_available_memory on -CURRENT. This change ensures that arc_available_memory uses the new symbol while maintaining compatibility with older FreeBSD releases. Reviewed-by: Brian Behlendorf Signed-off-by: Bojan Novković Closes #16230 --- module/os/freebsd/zfs/arc_os.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/module/os/freebsd/zfs/arc_os.c b/module/os/freebsd/zfs/arc_os.c index 92696c0bf1ae..e271d3bf98a0 100644 --- a/module/os/freebsd/zfs/arc_os.c +++ b/module/os/freebsd/zfs/arc_os.c @@ -89,17 +89,17 @@ arc_available_memory(void) if (n < lowest) { lowest = n; } -#if defined(__i386) || !defined(UMA_MD_SMALL_ALLOC) +#if !defined(UMA_MD_SMALL_ALLOC) && !defined(UMA_USE_DMAP) /* - * If we're on an i386 platform, it's possible that we'll exhaust the - * kernel heap space before we ever run out of available physical - * memory. Most checks of the size of the heap_area compare against - * tune.t_minarmem, which is the minimum available real memory that we - * can have in the system. However, this is generally fixed at 25 pages - * which is so low that it's useless. In this comparison, we seek to - * calculate the total heap-size, and reclaim if more than 3/4ths of the - * heap is allocated. (Or, in the calculation, if less than 1/4th is - * free) + * If we're on a platform without a direct map, it's possible that we'll + * exhaust the kernel heap space before we ever run out of available + * physical memory. Most checks of the size of the heap_area compare + * against tune.t_minarmem, which is the minimum available real memory + * that we can have in the system. However, this is generally fixed at + * 25 pages which is so low that it's useless. In this comparison, we + * seek to calculate the total heap-size, and reclaim if more than + * 3/4ths of the heap is allocated. (Or, in the calculation, if less + * than 1/4th is free) */ n = uma_avail() - (long)(uma_limit() / 4); if (n < lowest) {