|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen staging] xen/gnttab: Export opt_max_{grant, maptrack}_frames
commit 890b9b8075121c8c2f99ff6135cd1581bc5cb383
Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Mar 19 15:33:32 2018 +0000
Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Mon Jul 23 11:11:02 2018 +0100
xen/gnttab: Export opt_max_{grant,maptrack}_frames
This is to facilitate the values being passed in via domain_create(), at
which
point the dom0 construction code needs to know them.
While cleaning up, drop the DEFAULT_* defines, which are only used
immediately
adjacent in a context which makes it obvious that they are the defaults, and
drop the (unused) logic to allow a per-arch override of
DEFAULT_MAX_NR_GRANT_FRAMES.
No functional change.
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
xen/common/grant_table.c | 26 +++++++++-----------------
xen/include/xen/grant_table.h | 3 +++
2 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 51a4a7d20e..d9ec711c73 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -82,20 +82,11 @@ struct grant_table {
struct grant_table_arch arch;
};
-#ifndef DEFAULT_MAX_NR_GRANT_FRAMES /* to allow arch to override */
-/* Default maximum size of a grant table. [POLICY] */
-#define DEFAULT_MAX_NR_GRANT_FRAMES 64
-#endif
-
-static unsigned int __read_mostly max_grant_frames =
- DEFAULT_MAX_NR_GRANT_FRAMES;
-integer_runtime_param("gnttab_max_frames", max_grant_frames);
-
-#define DEFAULT_MAX_MAPTRACK_FRAMES 1024
+unsigned int __read_mostly opt_max_grant_frames = 64;
+integer_runtime_param("gnttab_max_frames", opt_max_grant_frames);
-static unsigned int __read_mostly max_maptrack_frames =
- DEFAULT_MAX_MAPTRACK_FRAMES;
-integer_runtime_param("gnttab_max_maptrack_frames", max_maptrack_frames);
+unsigned int __read_mostly opt_max_maptrack_frames = 1024;
+integer_runtime_param("gnttab_max_maptrack_frames", opt_max_maptrack_frames);
static unsigned int __read_mostly opt_gnttab_max_version = 2;
static bool __read_mostly opt_transitive_grants = true;
@@ -3609,7 +3600,8 @@ grant_table_create(
if ( d->domain_id == 0 )
{
- ret = grant_table_init(d, t, gnttab_dom0_frames(),
max_maptrack_frames);
+ ret = grant_table_init(d, t, gnttab_dom0_frames(),
+ opt_max_maptrack_frames);
}
return ret;
@@ -3811,8 +3803,8 @@ int grant_table_set_limits(struct domain *d, unsigned int
grant_frames,
struct grant_table *gt = d->grant_table;
if ( grant_frames < INITIAL_NR_GRANT_FRAMES ||
- grant_frames > max_grant_frames ||
- maptrack_frames > max_maptrack_frames )
+ grant_frames > opt_max_grant_frames ||
+ maptrack_frames > opt_max_maptrack_frames )
return -EINVAL;
if ( !gt )
return -ENOENT;
@@ -3992,7 +3984,7 @@ __initcall(gnttab_usage_init);
unsigned int __init gnttab_dom0_frames(void)
{
- return min(max_grant_frames, gnttab_dom0_max());
+ return min(opt_max_grant_frames, gnttab_dom0_max());
}
/*
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index b3a95fda58..0286ba33dd 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -31,6 +31,9 @@
struct grant_table;
+extern unsigned int opt_max_grant_frames;
+extern unsigned int opt_max_maptrack_frames;
+
/* Create/destroy per-domain grant table context. */
int grant_table_create(
struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#staging
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |