From: Meng Xu <mengxu@cis.upenn.edu>
To: xen-devel@lists.xen.org
Cc: george.dunlap@eu.citrix.com, dario.faggioli@citrix.com,
ian.jackson@eu.citrix.com, xumengpanda@gmail.com,
Meng Xu <mengxu@cis.upenn.edu>,
wei.liu@citrix.com
Subject: [PATCH v2 2/5] libxl: enable per-VCPU extratime flag for RTDS
Date: Fri, 1 Sep 2017 11:58:49 -0400 [thread overview]
Message-ID: <1504281532-3766-3-git-send-email-mengxu@cis.upenn.edu> (raw)
In-Reply-To: <1504281532-3766-1-git-send-email-mengxu@cis.upenn.edu>
Modify libxl_vcpu_sched_params_get/set and sched_rtds_vcpu_get/set
functions to support per-VCPU extratime flag
Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>
---
Changes from v1
1) Add LIBXL_HAVE_SCHED_RTDS_VCPU_EXTRA to indicate if extratime flag is
supported
2) Change flag name in domctl.h from XEN_DOMCTL_SCHED_RTDS_extratime to
XEN_DOMCTL_SCHEDRT_extra
Changes from RFC v1
Change work_conserving flag to extratime flag
---
tools/libxl/libxl_sched.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
tools/libxl/libxl.h | 6 ++++++
tools/libxl/libxl_sched.c | 18 ++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 1704525..ead300f 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -257,6 +257,12 @@
#define LIBXL_HAVE_SCHED_RTDS_VCPU_PARAMS 1
/*
+ * LIBXL_HAVE_SCHED_RTDS_VCPU_EXTRA indicates RTDS scheduler
+ * now supports per-vcpu extratime settings.
+ */
+#define LIBXL_HAVE_SCHED_RTDS_VCPU_EXTRA 1
+
+/*
* libxl_domain_build_info has the arm.gic_version field.
*/
#define LIBXL_HAVE_BUILDINFO_ARM_GIC_VERSION 1
diff --git a/tools/libxl/libxl_sched.c b/tools/libxl/libxl_sched.c
index faa604e..b76a29a 100644
--- a/tools/libxl/libxl_sched.c
+++ b/tools/libxl/libxl_sched.c
@@ -558,6 +558,10 @@ static int sched_rtds_vcpu_get_all(libxl__gc *gc, uint32_t domid,
for (i = 0; i < num_vcpus; i++) {
scinfo->vcpus[i].period = vcpus[i].u.rtds.period;
scinfo->vcpus[i].budget = vcpus[i].u.rtds.budget;
+ if (vcpus[i].u.rtds.flags & XEN_DOMCTL_SCHEDRT_extra)
+ scinfo->vcpus[i].extratime = 1;
+ else
+ scinfo->vcpus[i].extratime = 0;
scinfo->vcpus[i].vcpuid = vcpus[i].vcpuid;
}
rc = 0;
@@ -607,6 +611,10 @@ static int sched_rtds_vcpu_set(libxl__gc *gc, uint32_t domid,
vcpus[i].vcpuid = scinfo->vcpus[i].vcpuid;
vcpus[i].u.rtds.period = scinfo->vcpus[i].period;
vcpus[i].u.rtds.budget = scinfo->vcpus[i].budget;
+ if (scinfo->vcpus[i].extratime)
+ vcpus[i].u.rtds.flags |= XEN_DOMCTL_SCHEDRT_extra;
+ else
+ vcpus[i].u.rtds.flags &= ~XEN_DOMCTL_SCHEDRT_extra;
}
r = xc_sched_rtds_vcpu_set(CTX->xch, domid,
@@ -655,6 +663,10 @@ static int sched_rtds_vcpu_set_all(libxl__gc *gc, uint32_t domid,
vcpus[i].vcpuid = i;
vcpus[i].u.rtds.period = scinfo->vcpus[0].period;
vcpus[i].u.rtds.budget = scinfo->vcpus[0].budget;
+ if (scinfo->vcpus[0].extratime)
+ vcpus[i].u.rtds.flags |= XEN_DOMCTL_SCHEDRT_extra;
+ else
+ vcpus[i].u.rtds.flags &= ~XEN_DOMCTL_SCHEDRT_extra;
}
r = xc_sched_rtds_vcpu_set(CTX->xch, domid,
@@ -705,6 +717,12 @@ static int sched_rtds_domain_set(libxl__gc *gc, uint32_t domid,
sdom.period = scinfo->period;
if (scinfo->budget != LIBXL_DOMAIN_SCHED_PARAM_BUDGET_DEFAULT)
sdom.budget = scinfo->budget;
+ if (scinfo->extratime != LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT) {
+ if (scinfo->extratime)
+ sdom.flags |= XEN_DOMCTL_SCHEDRT_extra;
+ else
+ sdom.flags &= ~XEN_DOMCTL_SCHEDRT_extra;
+ }
if (sched_rtds_validate_params(gc, sdom.period, sdom.budget))
return ERROR_INVAL;
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-09-01 15:58 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-01 15:58 [PATCH v2 0/5] Towards work-conserving RTDS Meng Xu
2017-09-01 15:58 ` [PATCH v2 1/5] xen:rtds: towards work conserving RTDS Meng Xu
2017-09-14 1:06 ` Dario Faggioli
2017-09-15 15:38 ` Meng Xu
2017-09-01 15:58 ` Meng Xu [this message]
2017-09-01 16:03 ` [PATCH v2 2/5] libxl: enable per-VCPU extratime flag for RTDS Meng Xu
2017-09-14 0:16 ` Dario Faggioli
2017-09-15 16:01 ` Meng Xu
2017-09-19 9:23 ` Dario Faggioli
2017-10-09 16:08 ` Meng Xu
2017-09-14 0:12 ` Dario Faggioli
2017-09-01 15:58 ` [PATCH v2 3/5] xl: " Meng Xu
2017-09-14 0:51 ` Dario Faggioli
2017-10-09 16:13 ` Meng Xu
2017-10-09 17:19 ` Dario Faggioli
2017-09-14 0:58 ` Dario Faggioli
2017-09-01 15:58 ` [PATCH v2 4/5] xentrace: " Meng Xu
2017-09-14 0:55 ` Dario Faggioli
2017-09-01 15:58 ` [PATCH v2 5/5] docs: " Meng Xu
2017-09-14 0:59 ` Dario Faggioli
2017-09-13 10:28 ` [PATCH v2 0/5] Towards work-conserving RTDS Wei Liu
2017-09-13 10:42 ` Dario Faggioli
2017-10-02 14:38 ` Andrii Anisov
2017-10-02 17:04 ` Dario Faggioli
2017-10-02 19:18 ` Meng Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1504281532-3766-3-git-send-email-mengxu@cis.upenn.edu \
--to=mengxu@cis.upenn.edu \
--cc=dario.faggioli@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=wei.liu@citrix.com \
--cc=xen-devel@lists.xen.org \
--cc=xumengpanda@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).