|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v1 12/25] xen/domctl: wrap around XEN_DOMCTL_scheduler_op
Function sched_adjust() is responsible for XEN_DOMCTL_scheduler_op domctl-op.
Tracing its calling chain, the following functions shall be wrapped too:
- xsm_domctl_scheduler_op()
- sched_adjust_dom()
- scheduler-specific .adjust() callback
Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
---
xen/common/sched/arinc653.c | 2 ++
xen/common/sched/core.c | 2 ++
xen/common/sched/credit.c | 4 ++++
xen/common/sched/credit2.c | 4 ++++
xen/common/sched/private.h | 4 ++++
xen/common/sched/rt.c | 4 ++++
xen/include/xsm/xsm.h | 4 ++++
xen/xsm/dummy.c | 2 ++
xen/xsm/flask/hooks.c | 4 ++++
9 files changed, 30 insertions(+)
diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 8a4f4259d8..e73b0256a6 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -735,7 +735,9 @@ static const struct scheduler sched_arinc653_def = {
.switch_sched = a653_switch_sched,
+#ifdef CONFIG_DOMCTL
.adjust = NULL,
+#endif
#ifdef CONFIG_SYSCTL
.adjust_global = a653sched_adjust_global,
#endif
diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 14f27fe70f..896178b32f 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -2080,6 +2080,7 @@ int scheduler_id(void)
}
#endif
+#ifdef CONFIG_DOMCTL
/* Adjust scheduling parameter for a given domain. */
long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op)
{
@@ -2114,6 +2115,7 @@ long sched_adjust(struct domain *d, struct
xen_domctl_scheduler_op *op)
return ret;
}
+#endif /* CONFIG_DOMCTL */
#ifdef CONFIG_SYSCTL
long sched_adjust_global(struct xen_sysctl_scheduler_op *op)
diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index 6dcf6b2c8b..fff1af063e 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -1183,6 +1183,7 @@ csched_unit_yield(const struct scheduler *ops, struct
sched_unit *unit)
set_bit(CSCHED_FLAG_UNIT_YIELD, &svc->flags);
}
+#ifdef CONFIG_DOMCTL
static int cf_check
csched_dom_cntl(
const struct scheduler *ops,
@@ -1227,6 +1228,7 @@ csched_dom_cntl(
return rc;
}
+#endif /* CONFIG_DOMCTL */
static void cf_check
csched_aff_cntl(const struct scheduler *ops, struct sched_unit *unit,
@@ -2288,7 +2290,9 @@ static const struct scheduler sched_credit_def = {
.wake = csched_unit_wake,
.yield = csched_unit_yield,
+#ifdef CONFIG_DOMCTL
.adjust = csched_dom_cntl,
+#endif
.adjust_affinity= csched_aff_cntl,
#ifdef CONFIG_SYSCTL
.adjust_global = csched_sys_cntl,
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 75316d42b7..51784d9aab 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -2909,6 +2909,7 @@ static void cf_check csched2_unit_migrate(
sched_set_res(unit, get_sched_res(new_cpu));
}
+#ifdef CONFIG_DOMCTL
static int cf_check
csched2_dom_cntl(
const struct scheduler *ops,
@@ -3114,6 +3115,7 @@ csched2_dom_cntl(
return rc;
}
+#endif /* CONFIG_DOMCTL */
static void cf_check
csched2_aff_cntl(const struct scheduler *ops, struct sched_unit *unit,
@@ -4246,7 +4248,9 @@ static const struct scheduler sched_credit2_def = {
.wake = csched2_unit_wake,
.yield = csched2_unit_yield,
+#ifdef CONFIG_DOMCTL
.adjust = csched2_dom_cntl,
+#endif
.adjust_affinity= csched2_aff_cntl,
#ifdef CONFIG_SYSCTL
.adjust_global = csched2_sys_cntl,
diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h
index d6884550cd..b8841c9308 100644
--- a/xen/common/sched/private.h
+++ b/xen/common/sched/private.h
@@ -349,9 +349,11 @@ struct scheduler {
void (*migrate) (const struct scheduler *ops,
struct sched_unit *unit,
unsigned int new_cpu);
+#ifdef CONFIG_DOMCTL
int (*adjust) (const struct scheduler *ops,
struct domain *d,
struct xen_domctl_scheduler_op *op);
+#endif
void (*adjust_affinity)(const struct scheduler *ops,
struct sched_unit *unit,
const struct cpumask *hard,
@@ -506,11 +508,13 @@ static inline void sched_adjust_affinity(const struct
scheduler *s,
s->adjust_affinity(s, unit, hard, soft);
}
+#ifdef CONFIG_DOMCTL
static inline int sched_adjust_dom(const struct scheduler *s, struct domain *d,
struct xen_domctl_scheduler_op *op)
{
return s->adjust ? s->adjust(s, d, op) : 0;
}
+#endif
#ifdef CONFIG_SYSCTL
static inline int sched_adjust_cpupool(const struct scheduler *s,
diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index 7b1f64a779..fd677b4f09 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -1362,6 +1362,7 @@ out:
unit_schedule_unlock_irq(lock, unit);
}
+#ifdef CONFIG_DOMCTL
/*
* set/get each unit info of each domain
*/
@@ -1471,6 +1472,7 @@ rt_dom_cntl(
return rc;
}
+#endif /* CONFIG_DOMCTL */
/*
* The replenishment timer handler picks units
@@ -1572,7 +1574,9 @@ static const struct scheduler sched_rtds_def = {
.insert_unit = rt_unit_insert,
.remove_unit = rt_unit_remove,
+#ifdef CONFIG_DOMCTL
.adjust = rt_dom_cntl,
+#endif
.pick_resource = rt_res_pick,
.do_schedule = rt_schedule,
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 7c61f27366..6444f0677b 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -56,7 +56,9 @@ struct xsm_ops {
struct xen_domctl_getdomaininfo *info);
int (*domain_create)(struct domain *d, uint32_t ssidref);
int (*getdomaininfo)(struct domain *d);
+#ifdef CONFIG_DOMCTL
int (*domctl_scheduler_op)(struct domain *d, int op);
+#endif
#ifdef CONFIG_SYSCTL
int (*sysctl_scheduler_op)(int op);
#endif
@@ -242,11 +244,13 @@ static inline int xsm_get_domain_state(xsm_default_t def,
struct domain *d)
return alternative_call(xsm_ops.get_domain_state, d);
}
+#ifdef CONFIG_DOMCTL
static inline int xsm_domctl_scheduler_op(
xsm_default_t def, struct domain *d, int cmd)
{
return alternative_call(xsm_ops.domctl_scheduler_op, d, cmd);
}
+#endif
#ifdef CONFIG_SYSCTL
static inline int xsm_sysctl_scheduler_op(xsm_default_t def, int cmd)
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 6f8b06b45f..b8a9b581b7 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -18,7 +18,9 @@ static const struct xsm_ops __initconst_cf_clobber dummy_ops
= {
.security_domaininfo = xsm_security_domaininfo,
.domain_create = xsm_domain_create,
.getdomaininfo = xsm_getdomaininfo,
+#ifdef CONFIG_DOMCTL
.domctl_scheduler_op = xsm_domctl_scheduler_op,
+#endif
#ifdef CONFIG_SYSCTL
.sysctl_scheduler_op = xsm_sysctl_scheduler_op,
#endif
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index fd7aea460f..55da0a5ff7 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -609,6 +609,7 @@ static int cf_check flask_getdomaininfo(struct domain *d)
return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO);
}
+#ifdef CONFIG_DOMCTL
static int cf_check flask_domctl_scheduler_op(struct domain *d, int op)
{
switch ( op )
@@ -625,6 +626,7 @@ static int cf_check flask_domctl_scheduler_op(struct domain
*d, int op)
return avc_unknown_permission("domctl_scheduler_op", op);
}
}
+#endif /* CONFIG_DOMCTL */
#ifdef CONFIG_SYSCTL
static int cf_check flask_sysctl_scheduler_op(int op)
@@ -1890,7 +1892,9 @@ static const struct xsm_ops __initconst_cf_clobber
flask_ops = {
.security_domaininfo = flask_security_domaininfo,
.domain_create = flask_domain_create,
.getdomaininfo = flask_getdomaininfo,
+#ifdef CONFIG_DOMCTL
.domctl_scheduler_op = flask_domctl_scheduler_op,
+#endif
#ifdef CONFIG_SYSCTL
.sysctl_scheduler_op = flask_sysctl_scheduler_op,
#endif
--
2.34.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |