@@ -613,6 +613,12 @@ Specify the serial parameters for the GDB stub.
Specify the maximum number of frames per grant table operation.
+### gnttab\_max\_nr\_maptrack\_frames
+> `= <integer>`
+
+Specify the maximum number of maptrack frames domain.
+The default value is 8 times gnttab_max_nr_frames.
+
### guest\_loglvl
> `= <level>[/<rate-limited level>]` where level is `none | error | warning | info | debug | all`
@@ -102,10 +102,9 @@ nr_maptrack_frames(struct grant_table *t)
return t->maptrack_limit / MAPTRACK_PER_PAGE;
}
-static unsigned inline int max_nr_maptrack_frames(void)
-{
- return (max_nr_grant_frames * MAX_MAPTRACK_TO_GRANTS_RATIO);
-}
+static unsigned int max_nr_maptrack_frames = DEFAULT_MAX_NR_GRANT_FRAMES *
+ MAX_MAPTRACK_TO_GRANTS_RATIO;
+integer_param("gnttab_max_nr_maptrack_frames", max_nr_maptrack_frames);
#define MAPTRACK_TAIL (~0u)
@@ -271,7 +270,7 @@ get_maptrack_handle(
while ( unlikely((handle = __get_maptrack_handle(lgt)) == -1) )
{
nr_frames = nr_maptrack_frames(lgt);
- if ( nr_frames >= max_nr_maptrack_frames() )
+ if ( nr_frames >= max_nr_maptrack_frames )
break;
new_mt = alloc_xenheap_page();
@@ -2659,7 +2658,7 @@ grant_table_create(
/* Tracking of mapped foreign frames table */
if ( (t->maptrack = xzalloc_array(struct grant_mapping *,
- max_nr_maptrack_frames())) == NULL )
+ max_nr_maptrack_frames)) == NULL )
goto no_mem_2;
if ( (t->maptrack[0] = alloc_xenheap_page()) == NULL )
goto no_mem_3;
Introduce a new Xen command line option to specify the max number of maptrack frames per domain. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> --- docs/misc/xen-command-line.markdown | 6 ++++++ xen/common/grant_table.c | 11 +++++------ 2 files changed, 11 insertions(+), 6 deletions(-)