[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] xen/grants: repurpose command line max options
commit b2ea81d2b935474cf27a76b4aa143ae897e82457 Author: Roger Pau Monne <roger.pau@xxxxxxxxxx> AuthorDate: Tue Mar 14 15:45:53 2023 +0100 Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> CommitDate: Wed Mar 15 18:41:46 2023 +0000 xen/grants: repurpose command line max options Slightly change the meaning of the command line gnttab_max_{maptrack_,}frames: do not use them as upper bounds for the passed values at domain creation, instead just use them as defaults in the absence of any provided value. It's not very useful for the options to be used both as defaults and as capping values for domain creation inputs. The defaults passed on the command line are used by dom0 which has a very different grant requirements than a regular domU. dom0 usually needs a bigger maptrack array, while domU usually require a bigger number of grant frames. The relaxation in the logic for the maximum size of the grant and maptrack table sizes doesn't change the fact that domain creation hypercall can cause resource exhausting, so disaggregated setups should take it into account. Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> --- docs/misc/xen-command-line.pandoc | 16 +++++++++------- xen/common/grant_table.c | 9 +++------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc index f68deaa6a9..e0b89b7d33 100644 --- a/docs/misc/xen-command-line.pandoc +++ b/docs/misc/xen-command-line.pandoc @@ -1232,11 +1232,11 @@ The usage of gnttab v2 is not security supported on ARM platforms. > Can be modified at runtime -Specify the maximum number of frames which any domain may use as part -of its grant table. This value is an upper boundary of the per-domain -value settable via Xen tools. +Specify the default upper bound on the number of frames which any domain may +use as part of its grant table unless a different value is specified at domain +creation. -Dom0 is using this value for sizing its grant table. +Note this value is the effective upper bound for dom0. ### gnttab_max_maptrack_frames > `= <integer>` @@ -1245,9 +1245,11 @@ Dom0 is using this value for sizing its grant table. > Can be modified at runtime -Specify the maximum number of frames to use as part of a domains -maptrack array. This value is an upper boundary of the per-domain -value settable via Xen tools. +Specify the default upper bound on the number of frames which any domain may +use as part of its maptrack array unless a different value is specified at +domain creation. + +Note this value is the effective upper bound for dom0. ### global-pages = <boolean> diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index b896f9af0e..d87e58a53d 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -1956,18 +1956,15 @@ int grant_table_init(struct domain *d, int max_grant_frames, return -EINVAL; } - /* Default to maximum value if no value was specified */ + /* Apply defaults if no value was specified */ if ( max_grant_frames < 0 ) max_grant_frames = opt_max_grant_frames; if ( max_maptrack_frames < 0 ) max_maptrack_frames = opt_max_maptrack_frames; - if ( max_grant_frames < INITIAL_NR_GRANT_FRAMES || - max_grant_frames > opt_max_grant_frames || - max_maptrack_frames > opt_max_maptrack_frames ) + if ( max_grant_frames < INITIAL_NR_GRANT_FRAMES ) { - dprintk(XENLOG_INFO, "Bad grant table sizes: grant %u, maptrack %u\n", - max_grant_frames, max_maptrack_frames); + dprintk(XENLOG_INFO, "Bad grant table size: %u frames\n", max_grant_frames); return -EINVAL; } -- generated by git-patchbot for /home/xen/git/xen.git#master
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |