|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] xen/sysctl: wrap around XEN_SYSCTL_scheduler_op
commit 4493d39e68c242ee3fac877fb93048070ebfef80
Author: Penny Zheng <Penny.Zheng@xxxxxxx>
AuthorDate: Fri Jul 11 12:31:55 2025 +0800
Commit: Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Wed Jul 16 17:36:37 2025 -0700
xen/sysctl: wrap around XEN_SYSCTL_scheduler_op
Function sched_adjust_global is designed for XEN_SYSCTL_scheduler_op, so
itself and its calling flow, like .adjust_global, shall all be wrapped.
Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Acked-by: Stewart Hildebrand <stewart@xxxxxxx> #a653
Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
Acked-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
xen/common/sched/arinc653.c | 6 ++++++
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/include/xsm/xsm.h | 4 ++++
xen/xsm/dummy.c | 2 ++
xen/xsm/flask/hooks.c | 4 ++++
8 files changed, 30 insertions(+)
diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 432ccfe662..3c014c9934 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -220,6 +220,7 @@ static void update_schedule_units(const struct scheduler
*ops)
SCHED_PRIV(ops)->schedule[i].unit_id);
}
+#ifdef CONFIG_SYSCTL
/**
* This function is called by the adjust_global scheduler hook to put
* in place a new ARINC653 schedule.
@@ -334,6 +335,7 @@ arinc653_sched_get(
return 0;
}
+#endif /* CONFIG_SYSCTL */
/**************************************************************************
* Scheduler callback functions *
@@ -653,6 +655,7 @@ a653_switch_sched(struct scheduler *new_ops, unsigned int
cpu,
return &sr->_lock;
}
+#ifdef CONFIG_SYSCTL
/**
* Xen scheduler callback function to perform a global (not domain-specific)
* adjustment. It is used by the ARINC 653 scheduler to put in place a new
@@ -692,6 +695,7 @@ a653sched_adjust_global(const struct scheduler *ops,
return rc;
}
+#endif /* CONFIG_SYSCTL */
/**
* This structure defines our scheduler for Xen.
@@ -726,7 +730,9 @@ static const struct scheduler sched_arinc653_def = {
.switch_sched = a653_switch_sched,
.adjust = NULL,
+#ifdef CONFIG_SYSCTL
.adjust_global = a653sched_adjust_global,
+#endif
.dump_settings = NULL,
.dump_cpu_state = NULL,
diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 13fdf57e57..ea95dea65a 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -2112,6 +2112,7 @@ long sched_adjust(struct domain *d, struct
xen_domctl_scheduler_op *op)
return ret;
}
+#ifdef CONFIG_SYSCTL
long sched_adjust_global(struct xen_sysctl_scheduler_op *op)
{
struct cpupool *pool;
@@ -2140,6 +2141,7 @@ long sched_adjust_global(struct xen_sysctl_scheduler_op
*op)
return rc;
}
+#endif /* CONFIG_SYSCTL */
static void vcpu_periodic_timer_work_locked(struct vcpu *v)
{
diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index a6bb321e7d..6dcf6b2c8b 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -1256,6 +1256,7 @@ __csched_set_tslice(struct csched_private *prv, unsigned
int timeslice_ms)
prv->credit = prv->credits_per_tslice * prv->ncpus;
}
+#ifdef CONFIG_SYSCTL
static int cf_check
csched_sys_cntl(const struct scheduler *ops,
struct xen_sysctl_scheduler_op *sc)
@@ -1298,6 +1299,7 @@ csched_sys_cntl(const struct scheduler *ops,
out:
return rc;
}
+#endif /* CONFIG_SYSCTL */
static void *cf_check
csched_alloc_domdata(const struct scheduler *ops, struct domain *dom)
@@ -2288,7 +2290,9 @@ static const struct scheduler sched_credit_def = {
.adjust = csched_dom_cntl,
.adjust_affinity= csched_aff_cntl,
+#ifdef CONFIG_SYSCTL
.adjust_global = csched_sys_cntl,
+#endif
.pick_resource = csched_res_pick,
.do_schedule = csched_schedule,
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 0a83f23725..0b3b61df57 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3131,6 +3131,7 @@ csched2_aff_cntl(const struct scheduler *ops, struct
sched_unit *unit,
__clear_bit(__CSFLAG_pinned, &svc->flags);
}
+#ifdef CONFIG_SYSCTL
static int cf_check csched2_sys_cntl(
const struct scheduler *ops, struct xen_sysctl_scheduler_op *sc)
{
@@ -3162,6 +3163,7 @@ static int cf_check csched2_sys_cntl(
return 0;
}
+#endif /* CONFIG_SYSCTL */
static void *cf_check
csched2_alloc_domdata(const struct scheduler *ops, struct domain *dom)
@@ -4232,7 +4234,9 @@ static const struct scheduler sched_credit2_def = {
.adjust = csched2_dom_cntl,
.adjust_affinity= csched2_aff_cntl,
+#ifdef CONFIG_SYSCTL
.adjust_global = csched2_sys_cntl,
+#endif
.pick_resource = csched2_res_pick,
.migrate = csched2_unit_migrate,
diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h
index c0e7c96d24..d6884550cd 100644
--- a/xen/common/sched/private.h
+++ b/xen/common/sched/private.h
@@ -356,8 +356,10 @@ struct scheduler {
struct sched_unit *unit,
const struct cpumask *hard,
const struct cpumask *soft);
+#ifdef CONFIG_SYSCTL
int (*adjust_global) (const struct scheduler *ops,
struct xen_sysctl_scheduler_op *sc);
+#endif
void (*dump_settings) (const struct scheduler *ops);
void (*dump_cpu_state) (const struct scheduler *ops, int cpu);
void (*move_timers) (const struct scheduler *ops,
@@ -510,11 +512,13 @@ static inline int sched_adjust_dom(const struct scheduler
*s, struct domain *d,
return s->adjust ? s->adjust(s, d, op) : 0;
}
+#ifdef CONFIG_SYSCTL
static inline int sched_adjust_cpupool(const struct scheduler *s,
struct xen_sysctl_scheduler_op *op)
{
return s->adjust_global ? s->adjust_global(s, op) : 0;
}
+#endif
static inline void sched_move_timers(const struct scheduler *s,
struct sched_resource *sr)
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 5ac99904c4..6e1789c314 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -57,7 +57,9 @@ struct xsm_ops {
int (*domain_create)(struct domain *d, uint32_t ssidref);
int (*getdomaininfo)(struct domain *d);
int (*domctl_scheduler_op)(struct domain *d, int op);
+#ifdef CONFIG_SYSCTL
int (*sysctl_scheduler_op)(int op);
+#endif
int (*set_target)(struct domain *d, struct domain *e);
int (*domctl)(struct domain *d, unsigned int cmd, uint32_t ssidref);
int (*sysctl)(int cmd);
@@ -244,10 +246,12 @@ static inline int xsm_domctl_scheduler_op(
return alternative_call(xsm_ops.domctl_scheduler_op, d, cmd);
}
+#ifdef CONFIG_SYSCTL
static inline int xsm_sysctl_scheduler_op(xsm_default_t def, int cmd)
{
return alternative_call(xsm_ops.sysctl_scheduler_op, cmd);
}
+#endif
static inline int xsm_set_target(
xsm_default_t def, struct domain *d, struct domain *e)
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index d46413ad8c..8d44f5bfb6 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -19,7 +19,9 @@ static const struct xsm_ops __initconst_cf_clobber dummy_ops
= {
.domain_create = xsm_domain_create,
.getdomaininfo = xsm_getdomaininfo,
.domctl_scheduler_op = xsm_domctl_scheduler_op,
+#ifdef CONFIG_SYSCTL
.sysctl_scheduler_op = xsm_sysctl_scheduler_op,
+#endif
.set_target = xsm_set_target,
.domctl = xsm_domctl,
#ifdef CONFIG_SYSCTL
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 45c12aa662..a7cb33a718 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -626,6 +626,7 @@ static int cf_check flask_domctl_scheduler_op(struct domain
*d, int op)
}
}
+#ifdef CONFIG_SYSCTL
static int cf_check flask_sysctl_scheduler_op(int op)
{
switch ( op )
@@ -640,6 +641,7 @@ static int cf_check flask_sysctl_scheduler_op(int op)
return avc_unknown_permission("sysctl_scheduler_op", op);
}
}
+#endif /* CONFIG_SYSCTL */
static int cf_check flask_set_target(struct domain *d, struct domain *t)
{
@@ -1887,7 +1889,9 @@ static const struct xsm_ops __initconst_cf_clobber
flask_ops = {
.domain_create = flask_domain_create,
.getdomaininfo = flask_getdomaininfo,
.domctl_scheduler_op = flask_domctl_scheduler_op,
+#ifdef CONFIG_SYSCTL
.sysctl_scheduler_op = flask_sysctl_scheduler_op,
+#endif
.set_target = flask_set_target,
.domctl = flask_domctl,
#ifdef CONFIG_SYSCTL
--
generated by git-patchbot for /home/xen/git/xen.git#master
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |