diff options
author | ednadolski-ix <[email protected]> | 2023-10-26 10:13:01 -0600 |
---|---|---|
committer | GitHub <[email protected]> | 2023-10-26 09:13:01 -0700 |
commit | 6a629f32344468ae81b264055916641480cb438d (patch) | |
tree | bfabacc725193fa65095dc5dfecf26f11883453d /module | |
parent | 3afdc97d91c24192db51b67762126a8d99d433db (diff) |
arc_default_max on Linux should match FreeBSD
Commits 518b487 and 23bdb07 changed 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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Edmund Nadolski <[email protected]>
Closes #15437
Diffstat (limited to 'module')
-rw-r--r-- | module/os/linux/zfs/arc_os.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/module/os/linux/zfs/arc_os.c b/module/os/linux/zfs/arc_os.c index 29a8802b8..381563476 100644 --- a/module/os/linux/zfs/arc_os.c +++ b/module/os/linux/zfs/arc_os.c @@ -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 |