Make zc_nvlist_src_size limit tunable

We limit the size of nvlists passed to the kernel so a user cannot make
the kernel do an unreasonably large allocation.  On FreeBSD this limit
was 128 kiB, which turns out to be a bit too small when doing some
operations involving a large number of datasets or snapshots, for
example replication.

Make this limit tunable, with a platform-specific auto default.
Linux keeps its limit at KMALLOC_MAX_SIZE. FreeBSD uses 1/4 of the
system limit on user wired memory, which allows it to scale depending
on system configuration.

Reviewed-by: Matt Macy <mmacy@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org>
Issue #6572 
Closes #10706
This commit is contained in:
Ryan Moeller
2020-08-18 12:33:55 -04:00
committed by GitHub
parent 663a070c92
commit 009cc8e884
6 changed files with 51 additions and 4 deletions
-2
View File
@@ -162,8 +162,6 @@ extern "C" {
#define O_RSYNC 0
#define O_DSYNC 0
#define KMALLOC_MAX_SIZE MAXPHYS
#ifndef LOCORE
#ifndef HAVE_RPC_TYPES
typedef int bool_t;