Let default arc_c_max be platform dependent

Linux changed the default max ARC size to 1/2 of physical memory to
deal with shortcomings of the Linux SLUB allocator.  Other platforms
do not require the same logic.

Implement an arc_default_max() function to determine a default max ARC
size in platform code.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10155
This commit is contained in:
Ryan Moeller
2020-03-27 12:14:46 -04:00
committed by GitHub
parent 3f38797338
commit 9a51738b60
4 changed files with 22 additions and 8 deletions
+10
View File
@@ -60,6 +60,16 @@
int64_t last_free_memory;
free_memory_reason_t last_free_reason;
/*
* Return a default max arc size based on the amount of physical memory.
*/
uint64_t
arc_default_max(uint64_t min, uint64_t allmem)
{
/* Default to 1/2 of all memory. */
return (MAX(allmem / 2, min));
}
#ifdef _KERNEL
/*
* Return maximum amount of memory that we could possibly use. Reduced