Message ID | 20170906082632.6494-6-jgross@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
> -----Original Message----- > From: Xen-devel [mailto:xen-devel-bounces@lists.xen.org] On Behalf Of > Juergen Gross > Sent: 06 September 2017 09:26 > To: xen-devel@lists.xen.org > Cc: Juergen Gross <jgross@suse.com>; sstabellini@kernel.org; Wei Liu > <wei.liu2@citrix.com>; George Dunlap <George.Dunlap@citrix.com>; > Andrew Cooper <Andrew.Cooper3@citrix.com>; Ian Jackson > <Ian.Jackson@citrix.com>; Tim (Xen.org) <tim@xen.org>; > jbeulich@suse.com > Subject: [Xen-devel] [PATCH v2 5/8] xen: double default grant frame limit for > huge hosts > > In case a system has memory above the 16TB boundary double the default > grant frame number limit per domain. This ensures a pv domain can still > establish the same number of grants even if it is required to use > version 2 grants which need twice the space of v1 grants. > > Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Paul Durrant <paul.durrant@citrix.com> > --- > xen/common/grant_table.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c > index ae5f1262e8..709fd55490 100644 > --- a/xen/common/grant_table.c > +++ b/xen/common/grant_table.c > @@ -3824,8 +3824,15 @@ static int __init gnttab_usage_init(void) > { > BUILD_BUG_ON(DEFAULT_MAX_MAPTRACK_FRAMES < > DEFAULT_MAX_NR_GRANT_FRAMES); > > + /* > + * In case grant v2 is required for pv domains to reference any possible > + * memory page (i.e. memory is installed above 16TB boundary) double > the > + * grant frame limit. This will allow a guest using v2 grants without > + * having to lower the number of usable grants. > + */ > if ( !max_grant_frames ) > - max_grant_frames = DEFAULT_MAX_NR_GRANT_FRAMES; > + max_grant_frames = ((max_page >> 32) ? 2 : 1) * > + DEFAULT_MAX_NR_GRANT_FRAMES; > > if ( !max_maptrack_frames ) > max_maptrack_frames = DEFAULT_MAX_MAPTRACK_FRAMES; > -- > 2.12.3 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > https://lists.xen.org/xen-devel
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index ae5f1262e8..709fd55490 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -3824,8 +3824,15 @@ static int __init gnttab_usage_init(void) { BUILD_BUG_ON(DEFAULT_MAX_MAPTRACK_FRAMES < DEFAULT_MAX_NR_GRANT_FRAMES); + /* + * In case grant v2 is required for pv domains to reference any possible + * memory page (i.e. memory is installed above 16TB boundary) double the + * grant frame limit. This will allow a guest using v2 grants without + * having to lower the number of usable grants. + */ if ( !max_grant_frames ) - max_grant_frames = DEFAULT_MAX_NR_GRANT_FRAMES; + max_grant_frames = ((max_page >> 32) ? 2 : 1) * + DEFAULT_MAX_NR_GRANT_FRAMES; if ( !max_maptrack_frames ) max_maptrack_frames = DEFAULT_MAX_MAPTRACK_FRAMES;
In case a system has memory above the 16TB boundary double the default grant frame number limit per domain. This ensures a pv domain can still establish the same number of grants even if it is required to use version 2 grants which need twice the space of v1 grants. Signed-off-by: Juergen Gross <jgross@suse.com> --- xen/common/grant_table.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)