mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
arc_default_max on Linux should match FreeBSD
Commits518b487and23bdb07changed the default ARC size limit on Linux systems to 1/2 of physical memory, which has become too strict for modern systems with large amounts of RAM. This patch changes the default limit to match that of FreeBSD, so ZFS may have a unified value on both platforms. Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Edmund Nadolski <edmund.nadolski@ixsystems.com> Closes #15437
This commit is contained in:
@@ -80,12 +80,18 @@ static struct notifier_block arc_hotplug_callback_mem_nb;
|
||||
|
||||
/*
|
||||
* Return a default max arc size based on the amount of physical memory.
|
||||
* This may be overridden by tuning the zfs_arc_max module parameter.
|
||||
*/
|
||||
uint64_t
|
||||
arc_default_max(uint64_t min, uint64_t allmem)
|
||||
{
|
||||
/* Default to 1/2 of all memory. */
|
||||
return (MAX(allmem / 2, min));
|
||||
uint64_t size;
|
||||
|
||||
if (allmem >= 1 << 30)
|
||||
size = allmem - (1 << 30);
|
||||
else
|
||||
size = min;
|
||||
return (MAX(allmem * 5 / 8, size));
|
||||
}
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
Reference in New Issue
Block a user