Skip to content

Commit 20c8bdd

Browse files
authored
FreeBSD: Update use of UMA-related symbols in arc_available_memory
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 <[email protected]> Signed-off-by: Bojan Novković <[email protected]> Closes #16230
1 parent 4de260e commit 20c8bdd

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

module/os/freebsd/zfs/arc_os.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,17 @@ arc_available_memory(void)
8989
if (n < lowest) {
9090
lowest = n;
9191
}
92-
#if defined(__i386) || !defined(UMA_MD_SMALL_ALLOC)
92+
#if !defined(UMA_MD_SMALL_ALLOC) && !defined(UMA_USE_DMAP)
9393
/*
94-
* If we're on an i386 platform, it's possible that we'll exhaust the
95-
* kernel heap space before we ever run out of available physical
96-
* memory. Most checks of the size of the heap_area compare against
97-
* tune.t_minarmem, which is the minimum available real memory that we
98-
* can have in the system. However, this is generally fixed at 25 pages
99-
* which is so low that it's useless. In this comparison, we seek to
100-
* calculate the total heap-size, and reclaim if more than 3/4ths of the
101-
* heap is allocated. (Or, in the calculation, if less than 1/4th is
102-
* free)
94+
* If we're on a platform without a direct map, it's possible that we'll
95+
* exhaust the kernel heap space before we ever run out of available
96+
* physical memory. Most checks of the size of the heap_area compare
97+
* against tune.t_minarmem, which is the minimum available real memory
98+
* that we can have in the system. However, this is generally fixed at
99+
* 25 pages which is so low that it's useless. In this comparison, we
100+
* seek to calculate the total heap-size, and reclaim if more than
101+
* 3/4ths of the heap is allocated. (Or, in the calculation, if less
102+
* than 1/4th is free)
103103
*/
104104
n = uma_avail() - (long)(uma_limit() / 4);
105105
if (n < lowest) {

0 commit comments

Comments
 (0)