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.

Signed-off-by: Bojan Novković <bnovkov@FreeBSD.org>
This commit is contained in:
Bojan Novković 2024-05-26 20:22:27 +02:00
parent 02c5aa9b09
commit c08a97a3bd
1 changed files with 10 additions and 10 deletions

View File

@ -89,17 +89,17 @@ arc_available_memory(void)
if (n < lowest) { if (n < lowest) {
lowest = n; 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 * If we're on a platform without a direct map, it's possible that we'll
* kernel heap space before we ever run out of available physical * exhaust the kernel heap space before we ever run out of available
* memory. Most checks of the size of the heap_area compare against * physical memory. Most checks of the size of the heap_area compare
* tune.t_minarmem, which is the minimum available real memory that we * against tune.t_minarmem, which is the minimum available real memory
* can have in the system. However, this is generally fixed at 25 pages * that we can have in the system. However, this is generally fixed at
* which is so low that it's useless. In this comparison, we seek to * 25 pages which is so low that it's useless. In this comparison, we
* calculate the total heap-size, and reclaim if more than 3/4ths of the * seek to calculate the total heap-size, and reclaim if more than
* heap is allocated. (Or, in the calculation, if less than 1/4th is * 3/4ths of the heap is allocated. (Or, in the calculation, if less
* free) * than 1/4th is free)
*/ */
n = uma_avail() - (long)(uma_limit() / 4); n = uma_avail() - (long)(uma_limit() / 4);
if (n < lowest) { if (n < lowest) {