mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 10:54:35 +03:00
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:
+6
-6
@@ -7150,13 +7150,13 @@ arc_init(void)
|
||||
arc_lowmem_init();
|
||||
#endif
|
||||
|
||||
/* Set max to 1/2 of all memory */
|
||||
arc_c_max = allmem / 2;
|
||||
|
||||
#ifdef _KERNEL
|
||||
/* Set min cache to 1/32 of all memory, or 32MB, whichever is more */
|
||||
/* Set min cache to 1/32 of all memory, or 32MB, whichever is more. */
|
||||
arc_c_min = MAX(allmem / 32, 2ULL << SPA_MAXBLOCKSHIFT);
|
||||
#else
|
||||
|
||||
/* How to set default max varies by platform. */
|
||||
arc_c_max = arc_default_max(arc_c_min, allmem);
|
||||
|
||||
#ifndef _KERNEL
|
||||
/*
|
||||
* In userland, there's only the memory pressure that we artificially
|
||||
* create (see arc_available_memory()). Don't let arc_c get too
|
||||
|
||||
Reference in New Issue
Block a user