[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v6 07/12] xl: add global grant limit config items
Add xl.conf config items for default values of grant limits: max_grant_frames will set the default for the maximum number of grant frames for a domain which will take effect if the domain's config file doesn't specify a value. If max_grant_frames isn't set in xl.conf it will default to 32 for hosts with all memory below 16TB and to 64 for hosts with memory above 16TB. max_maptrack_frames will set the default for the maximum number of maptrack frames for a domain. If max_maptrack_frames isn't set in xl.conf it will default to 0, as normally only backend domains need maptrack frames. Signed-off-by: Juergen Gross <jgross@xxxxxxxx> --- docs/man/xl.conf.pod.5 | 12 ++++++++++++ tools/libxl/libxl.h | 9 ++++++++- tools/libxl/libxl_mem.c | 5 +++++ tools/xl/xl.c | 14 ++++++++++++++ tools/xl/xl.h | 2 ++ 5 files changed, 41 insertions(+), 1 deletion(-) diff --git a/docs/man/xl.conf.pod.5 b/docs/man/xl.conf.pod.5 index 88ab506609..fe2cf27ea4 100644 --- a/docs/man/xl.conf.pod.5 +++ b/docs/man/xl.conf.pod.5 @@ -77,6 +77,18 @@ operations (primarily domain creation). Default: C</var/lock/xl> +=item B<max_grant_frames=NUMBER> + +Sets the default value for the C<max_grant_frames> domain config value. + +Default: C<32> on hosts up to 16TB of memory, C<64> on hosts larger than 16TB + +=item B<max_maptrack_frames=NUMBER> + +Sets the default value for the C<max_maptrack_frames> domain config value. + +Default: C<0> + =item B<vif.default.script="PATH"> Configures the default hotplug script used by virtual network devices. diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 91408b47b5..9c455e59f9 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -311,6 +311,12 @@ #define LIBXL_HAVE_P9S 1 /* + * LIBXL_HAVE_GET_MAX_HOST_MFN indicates that libxl_get_max_host_mfn() is + * available. + */ +#define LIBXL_HAVE_GET_MAX_HOST_MFN 1 + +/* * libxl ABI compatibility * * The only guarantee which libxl makes regarding ABI compatibility @@ -1473,6 +1479,7 @@ int libxl_get_memory_target(libxl_ctx *ctx, uint32_t domid, uint64_t *out_target int libxl_get_memory_target_0x040700(libxl_ctx *ctx, uint32_t domid, uint32_t *out_target) LIBXL_EXTERNAL_CALLERS_ONLY; +int libxl_get_max_host_mfn(libxl_ctx *ctx, unsigned long *max_mfn); /* * WARNING @@ -1517,7 +1524,7 @@ int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs); #define libxl_domain_need_memory libxl_domain_need_memory_0x040700 #define libxl_get_free_memory libxl_get_free_memory_0x040700 #endif - + int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass); /* diff --git a/tools/libxl/libxl_mem.c b/tools/libxl/libxl_mem.c index f5d2530d8c..5e4096c104 100644 --- a/tools/libxl/libxl_mem.c +++ b/tools/libxl/libxl_mem.c @@ -592,6 +592,11 @@ out: return rc; } +int libxl_get_max_host_mfn(libxl_ctx *ctx, unsigned long *max_mfn) +{ + return xc_maximum_ram_page(ctx->xch, max_mfn) ? ERROR_FAIL : 0; +} + /* * Local variables: * mode: C diff --git a/tools/xl/xl.c b/tools/xl/xl.c index 02179a6229..1d54e4939e 100644 --- a/tools/xl/xl.c +++ b/tools/xl/xl.c @@ -45,6 +45,8 @@ char *default_colo_proxy_script = NULL; enum output_format default_output_format = OUTPUT_FORMAT_JSON; int claim_mode = 1; bool progress_use_cr = 0; +int max_grant_frames = -1; +int max_maptrack_frames = 0; xentoollog_level minmsglevel = minmsglevel_default; @@ -88,6 +90,7 @@ static void parse_global_config(const char *configfile, XLU_Config *config; int e; const char *buf; + unsigned long max_mfn; config = xlu_cfg_init(stderr, configfile); if (!config) { @@ -188,6 +191,17 @@ static void parse_global_config(const char *configfile, xlu_cfg_replace_string (config, "colo.default.proxyscript", &default_colo_proxy_script, 0); + if (!xlu_cfg_get_long (config, "max_grant_frames", &l, 0)) + max_grant_frames = l; + else { + if (libxl_get_max_host_mfn(ctx, &max_mfn) || !(max_mfn >> 32)) + max_grant_frames = 32; + else + max_grant_frames = 64; + } + if (!xlu_cfg_get_long (config, "max_maptrack_frames", &l, 0)) + max_maptrack_frames = l; + xlu_cfg_destroy(config); } diff --git a/tools/xl/xl.h b/tools/xl/xl.h index 01c2af64a6..178a0da05c 100644 --- a/tools/xl/xl.h +++ b/tools/xl/xl.h @@ -272,6 +272,8 @@ extern char *default_vifbackend; extern char *default_remus_netbufscript; extern char *default_colo_proxy_script; extern char *blkdev_start; +extern int max_grant_frames; +extern int max_maptrack_frames; enum output_format { OUTPUT_FORMAT_JSON, -- 2.12.3 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |