aboutsummaryrefslogtreecommitdiff
path: root/common/uapi/conf.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-10-09 14:57:18 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-10-09 16:15:06 +0300
commit9c9d589ea310f1290e4d6d2019fc8b51d9a86e42 (patch)
tree81694631f4e848728774c22256baf6cded4f910d /common/uapi/conf.c
parentb2f0f82e18665cb754b93d9795a6f1fb9dfc7c93 (diff)
downloadkmi-9c9d589ea310f1290e4d6d2019fc8b51d9a86e42.tar.gz
kmi-9c9d589ea310f1290e4d6d2019fc8b51d9a86e42.zip
move rpc stack handling to arch-specific code
+ Fairly considerable speedup, as we don't have to look up the rpc pte every time separately, instead cacheing them. Adds an architecture specific limitation to total rpc stack size, though.
Diffstat (limited to 'common/uapi/conf.c')
-rw-r--r--common/uapi/conf.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/common/uapi/conf.c b/common/uapi/conf.c
index 13be3ee..894b98a 100644
--- a/common/uapi/conf.c
+++ b/common/uapi/conf.c
@@ -18,14 +18,12 @@
/** \todo stack size should really be set on a per-thread basis, and are the
* conf*-syscalls even necessary? */
size_t __thread_stack_size = SZ_2M;
-size_t __call_stack_size = SZ_2M;
size_t __rpc_stack_size = SZ_512K;
/** IDs for configuration parameters. */
/** @todo should probably be moved somewhere so it can be shared with userspace */
enum conf_param {
CONF_THREAD_STACK = 0,
- CONF_CALL_STACK,
CONF_RPC_STACK,
};
@@ -49,10 +47,6 @@ SYSCALL_DEFINE1(conf_get)(struct tcb *t, sys_arg_t param)
val = __thread_stack_size;
break;
- case CONF_CALL_STACK:
- val = __call_stack_size;
- break;
-
case CONF_RPC_STACK:
val = __rpc_stack_size;
break;
@@ -85,17 +79,9 @@ SYSCALL_DEFINE2(conf_set)(struct tcb *t, sys_arg_t param, sys_arg_t val)
__thread_stack_size = align_up(val, BASE_PAGE_SIZE);
break;
- case CONF_CALL_STACK:
- size = align_up(val, BASE_PAGE_SIZE);
- if (size < __rpc_stack_size)
- return_args(t, SYS_RET1(ERR_MISC));
-
- __call_stack_size = size;
- break;
-
case CONF_RPC_STACK:
size = align_up(val, BASE_PAGE_SIZE);
- if (size > __call_stack_size)
+ if (size > max_rpc_size())
return_args1(t, ERR_MISC);
__rpc_stack_size = size;