]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Linux: increase max nvlist_src size
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 24 Feb 2021 17:57:18 +0000 (09:57 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 5 Mar 2021 20:54:57 +0000 (12:54 -0800)
On Linux increase the maximum allowed size of the src nvlist which
can be passed to the /dev/zfs ioctl.  Originally, this was set
to a maximum of KMALLOC_MAX_SIZE (4M) because it was kmalloc'd.
Since that time it's been converted to a vmalloc so that's no
longer a hard limit, and it's desirable for `zfs send/recv` to
allow larger nvlists so more snapshots can be sent at once.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6572
Closes #11638

man/man5/zfs-module-parameters.5
module/os/linux/zfs/zfs_ioctl_os.c

index 7c35040c3b271cfa8c6fdd18c31f2a689ca81103..d1fd6bed551d3c29d2e4ed51f23107028d84443c 100644 (file)
@@ -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
index b88e0497d000cf02feb34c74069c612fd677e362..6f5cff1770e16286a3d0bd6d6d0f8cea5de2e5ac 100644 (file)
@@ -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