diff --git a/man/man5/zfs-module-parameters.5 b/man/man5/zfs-module-parameters.5 index 7c35040c3..d1fd6bed5 100644 --- a/man/man5/zfs-module-parameters.5 +++ b/man/man5/zfs-module-parameters.5 @@ -1186,7 +1186,7 @@ amount of memory. When the limit is exceeded, the ioctl fails with EINVAL and a description of the error is sent to the zfs-dbgmsg log. This parameter should not need to be touched under normal circumstances. On FreeBSD, the default is based on the system limit on user wired memory. On Linux, the default is -\fBKMALLOC_MAX_SIZE\fR . +\fB128MB\fR. .sp Default value: \fB0\fR (kernel decides) .RE diff --git a/module/os/linux/zfs/zfs_ioctl_os.c b/module/os/linux/zfs/zfs_ioctl_os.c index b88e0497d..6f5cff177 100644 --- a/module/os/linux/zfs/zfs_ioctl_os.c +++ b/module/os/linux/zfs/zfs_ioctl_os.c @@ -209,7 +209,7 @@ zfs_max_nvlist_src_size_os(void) if (zfs_max_nvlist_src_size != 0) return (zfs_max_nvlist_src_size); - return (KMALLOC_MAX_SIZE); + return (MIN(ptob(zfs_totalram_pages) / 4, 128 * 1024 * 1024)); } void