Add tunables for channel programs

This patch adds tunables for modifying the maximum memory limit and
maximum instruction limit that can be specified when running a channel
program.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov
Reviewed-by: Sara Hartse <sara.hartse@delphix.com>
Signed-off-by: John Gallagher <john.gallagher@delphix.com>
External-issue: LX-1085
Closes #7618
This commit is contained in:
John Gallagher
2018-06-15 15:10:42 -07:00
committed by Brian Behlendorf
parent 7b98f0d91f
commit 917f475fba
5 changed files with 49 additions and 26 deletions
+15 -3
View File
@@ -14,7 +14,7 @@
*/
/*
* Copyright (c) 2016, 2017 by Delphix. All rights reserved.
* Copyright (c) 2016, 2018 by Delphix. All rights reserved.
*/
/*
@@ -108,8 +108,8 @@
#define ZCP_NVLIST_MAX_DEPTH 20
uint64_t zfs_lua_check_instrlimit_interval = 100;
uint64_t zfs_lua_max_instrlimit = ZCP_MAX_INSTRLIMIT;
uint64_t zfs_lua_max_memlimit = ZCP_MAX_MEMLIMIT;
unsigned long zfs_lua_max_instrlimit = ZCP_MAX_INSTRLIMIT;
unsigned long zfs_lua_max_memlimit = ZCP_MAX_MEMLIMIT;
/*
* Forward declarations for mutually recursive functions
@@ -1417,3 +1417,15 @@ zcp_parse_args(lua_State *state, const char *fname, const zcp_arg_t *pargs,
zcp_parse_pos_args(state, fname, pargs, kwargs);
}
}
#if defined(_KERNEL)
/* BEGIN CSTYLED */
module_param(zfs_lua_max_instrlimit, ulong, 0644);
MODULE_PARM_DESC(zfs_lua_max_instrlimit,
"Max instruction limit that can be specified for a channel program");
module_param(zfs_lua_max_memlimit, ulong, 0644);
MODULE_PARM_DESC(zfs_lua_max_memlimit,
"Max memory limit that can be specified for a channel program");
/* END CSTYLED */
#endif