From a83a4f9d105033aadc8b832b454d12329502fc2a Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 1 May 2017 13:01:39 -0700 Subject: [PATCH] Limit zfs_dirty_data_max_max to 4G Reinstate default 4G zfs_dirty_data_max_max limit. Reviewed-by: Giuseppe Di Natale Reviewed-by: Chunwei Chen Reviewed-by: George Melikov Signed-off-by: Brian Behlendorf Closes #6072 Closes #6081 --- module/zfs/arc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 04fde6c167..c72ced7585 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -5475,11 +5475,12 @@ arc_init(void) * If it has been set by a module parameter, take that. * Otherwise, use a percentage of physical memory defined by * zfs_dirty_data_max_percent (default 10%) with a cap at - * zfs_dirty_data_max_max (default 25% of physical memory). + * zfs_dirty_data_max_max (default 4G or 25% of physical memory). */ if (zfs_dirty_data_max_max == 0) - zfs_dirty_data_max_max = (uint64_t)physmem * PAGESIZE * - zfs_dirty_data_max_max_percent / 100; + zfs_dirty_data_max_max = MIN(4ULL * 1024 * 1024 * 1024, + (uint64_t)physmem * PAGESIZE * + zfs_dirty_data_max_max_percent / 100); if (zfs_dirty_data_max == 0) { zfs_dirty_data_max = (uint64_t)physmem * PAGESIZE *