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 <behlendorf1@llnl.gov> Signed-off-by: Bojan Novković <bnovkov@FreeBSD.org> Closes #16230
This commit is contained in:
parent
4de260efe3
commit
20c8bdd85e
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue