# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1273009410 -3600
# Node ID 7d07116efc2535de26fcd4122ee80d068b777e88
# Parent df8c580b523a0512ec294098e17711dfe93ea8a4
scheduler: Add a global parameter adjustment to the switchable scheduler
interface
...along with a new sysctl to call it directly. This is in order to
support DornerWorks' new ARINC653 scheduler.
Based on code from Josh Holtrop and Kathy Hadley at DornerWorks, Ltd
Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
---
xen/common/schedule.c | 15 +++++++++++++++
xen/common/sysctl.c | 8 ++++++++
xen/include/public/sysctl.h | 14 ++++++++++++++
xen/include/xen/sched.h | 1 +
4 files changed, 38 insertions(+)
diff -r df8c580b523a -r 7d07116efc25 xen/common/schedule.c
--- a/xen/common/schedule.c Tue May 04 22:42:34 2010 +0100
+++ b/xen/common/schedule.c Tue May 04 22:43:30 2010 +0100
@@ -882,6 +882,21 @@ long sched_adjust(struct domain *d, stru
return ret;
}
+long sched_adjust_global(struct xen_sysctl_scheduler_op *op)
+{
+ const struct scheduler *sched;
+
+ sched = scheduler_get_by_id(op->sched_id);
+ if ( sched == NULL )
+ return -ESRCH;
+
+ if ( (op->cmd != XEN_DOMCTL_SCHEDOP_putinfo) &&
+ (op->cmd != XEN_DOMCTL_SCHEDOP_getinfo) )
+ return -EINVAL;
+
+ return SCHED_OP(sched, adjust_global, op);
+}
+
static void vcpu_periodic_timer_work(struct vcpu *v)
{
s_time_t now = NOW();
diff -r df8c580b523a -r 7d07116efc25 xen/common/sysctl.c
--- a/xen/common/sysctl.c Tue May 04 22:42:34 2010 +0100
+++ b/xen/common/sysctl.c Tue May 04 22:43:30 2010 +0100
@@ -326,6 +326,14 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysc
}
break;
+ case XEN_SYSCTL_scheduler_op:
+ {
+ ret = sched_adjust_global(&op->u.scheduler_op);
+ if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
+ ret = -EFAULT;
+ }
+ break;
+
default:
ret = arch_do_sysctl(op, u_sysctl);
break;
diff -r df8c580b523a -r 7d07116efc25 xen/include/public/sysctl.h
--- a/xen/include/public/sysctl.h Tue May 04 22:42:34 2010 +0100
+++ b/xen/include/public/sysctl.h Tue May 04 22:43:30 2010 +0100
@@ -536,6 +536,19 @@ typedef struct xen_sysctl_cpupool_op xen
typedef struct xen_sysctl_cpupool_op xen_sysctl_cpupool_op_t;
DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpupool_op_t);
+#define XEN_SYSCTL_scheduler_op 19
+/* Set or get info? */
+#define XEN_SYSCTL_SCHEDOP_putinfo 0
+#define XEN_SYSCTL_SCHEDOP_getinfo 1
+struct xen_sysctl_scheduler_op {
+ uint32_t sched_id; /* XEN_SCHEDULER_* (domctl.h) */
+ uint32_t cmd; /* XEN_SYSCTL_SCHEDOP_* */
+ union {
+ } u;
+};
+typedef struct xen_sysctl_scheduler_op xen_sysctl_scheduler_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_scheduler_op_t);
+
struct xen_sysctl {
uint32_t cmd;
uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
@@ -557,6 +570,7 @@ struct xen_sysctl {
struct xen_sysctl_page_offline_op page_offline;
struct xen_sysctl_lockprof_op lockprof_op;
struct xen_sysctl_cpupool_op cpupool_op;
+ struct xen_sysctl_scheduler_op scheduler_op;
uint8_t pad[128];
} u;
};
diff -r df8c580b523a -r 7d07116efc25 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h Tue May 04 22:42:34 2010 +0100
+++ b/xen/include/xen/sched.h Tue May 04 22:43:30 2010 +0100
@@ -469,6 +469,7 @@ void sched_destroy_domain(struct domain
void sched_destroy_domain(struct domain *d);
int sched_move_domain(struct domain *d, struct cpupool *c);
long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
+long sched_adjust_global(struct xen_sysctl_scheduler_op *);
int sched_id(void);
void sched_tick_suspend(void);
void sched_tick_resume(void);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|