allowed vmprim.alloc_heap() to create a bigger heap than requested.

enhanced the standard implementation(std.c) to attempt HUGETLB if the requested heap size is over 1/2 of the huge page size
This commit is contained in:
2021-02-09 14:54:54 +00:00
parent aa8f8fac2d
commit 1d0c7a8bbc
10 changed files with 98 additions and 78 deletions

View File

@ -504,7 +504,6 @@ int main (int argc, char* argv[])
static hcl_bopt_lng_t lopt[] =
{
{ ":log", 'l' },
{ "large-pages", '\0' },
{ ":worker-max-count", '\0' },
{ ":worker-stack-size", '\0' },
{ ":worker-idle-timeout", '\0' },
@ -535,8 +534,6 @@ int main (int argc, char* argv[])
hcl_ntime_t worker_idle_timeout = { 0, 0 };
hcl_oow_t actor_heap_size = MIN_ACTOR_HEAP_SIZE;
hcl_ntime_t actor_max_runtime = { 0, 0 };
int large_pages = 0;
hcl_bitmask_t trait;
setlocale (LC_ALL, "");
@ -557,15 +554,11 @@ int main (int argc, char* argv[])
case 'm':
actor_heap_size = strtoul(opt.arg, HCL_NULL, 0);
if (actor_heap_size <= MIN_ACTOR_HEAP_SIZE) actor_heap_size = MIN_ACTOR_HEAP_SIZE;
if (actor_heap_size > 0 && actor_heap_size <= MIN_ACTOR_HEAP_SIZE) actor_heap_size = MIN_ACTOR_HEAP_SIZE;
break;
case '\0':
if (hcl_comp_bcstr(opt.lngopt, "large-pages") == 0)
{
large_pages = 1;
}
else if (hcl_comp_bcstr(opt.lngopt, "worker-max-count") == 0)
if (hcl_comp_bcstr(opt.lngopt, "worker-max-count") == 0)
{
worker_max_count = strtoul(opt.arg, HCL_NULL, 0);
}
@ -646,11 +639,6 @@ int main (int argc, char* argv[])
if (handle_incpath(server, incpath) <= -1) goto oops;
}
hcl_server_getoption (server, HCL_SERVER_TRAIT, &trait);
if (large_pages) trait |= HCL_SERVER_TRAIT_USE_LARGE_PAGES;
else trait &= ~HCL_SERVER_TRAIT_USE_LARGE_PAGES;
hcl_server_setoption (server, HCL_SERVER_TRAIT, &trait);
hcl_server_setoption (server, HCL_SERVER_WORKER_MAX_COUNT, &worker_max_count);
hcl_server_setoption (server, HCL_SERVER_WORKER_STACK_SIZE, &worker_stack_size);
hcl_server_setoption (server, HCL_SERVER_WORKER_IDLE_TIMEOUT, &worker_idle_timeout);

View File

@ -665,7 +665,6 @@ int main (int argc, char* argv[])
{ ":heapsize", '\0' },
{ ":log", 'l' },
{ "large-pages", '\0' },
{ HCL_NULL, '\0' }
};
static hcl_bopt_t opt =
@ -677,7 +676,6 @@ int main (int argc, char* argv[])
const char* logopt = HCL_NULL;
hcl_oow_t heapsize = DEFAULT_HEAPSIZE;
int verbose = 0;
int large_pages = 0;
#if defined(HCL_BUILD_DEBUG)
const char* dbgopt = HCL_NULL;
@ -711,11 +709,6 @@ int main (int argc, char* argv[])
heapsize = strtoul(opt.arg, HCL_NULL, 0);
break;
}
else if (hcl_comp_bcstr(opt.lngopt, "large-pages") == 0)
{
large_pages = 1;
break;
}
#if defined(HCL_BUILD_DEBUG)
else if (hcl_comp_bcstr(opt.lngopt, "debug") == 0)
{