From: Dario Faggioli <dario.faggioli@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Stefano Stabellini <stefano@aporeto.com>,
xen-devel@lists.xenproject.org,
Julien Grall <julien.grall@arm.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
George Dunlap <george.dunlap@citrix.com>
Subject: Re: [PATCH 3/3] tools: sched: add support for 'null' scheduler
Date: Fri, 7 Apr 2017 12:05:01 +0200 [thread overview]
Message-ID: <1491559501.3287.4.camel@citrix.com> (raw)
In-Reply-To: <20170407094212.obuxuv3dejrhb7vi@citrix.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 5781 bytes --]
On Fri, 2017-04-07 at 10:42 +0100, Wei Liu wrote:
> On Thu, Apr 06, 2017 at 05:18:33PM +0200, Dario Faggioli wrote:
> >
> > Wei acked this patch in v1 (20170321170902.ndk6h5ylyfkk4coo@citrix.
> > com)
> > but that was before you raised this, so I'm happy to resend with
> > this
> > changed, and doing whatever he prefers with his ack.
> >
> > Wei?
>
> I don't feel strongly about this. But if you want to return success
> in
> the get function, please make sure you initialise output to a known
> state, instead of returning random garbage.
>
Sure. That should not be a problem, as libxl_domain_sched_params_get()
calls, as the first thing it does, libxl_domain_sched_params_init(),
which sets all scinfo fields to their default.
Whatever I return, I won't touch scinfo at all, which means I'm just
returning those defaults.
So, can the below patch --which would make George much happier :-D
--also have your Ack?
Thanks and Regards,
Dario
---
tools: sched: add support for 'null' scheduler
From: Dario Faggioli <dario.faggioli@citrix.com>
It being very very basic, also means this scheduler does
not need much support at the tools level (for now).
Basically, just the definition of the symbol of the
scheduler itself and a couple of stubs.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
tools/libxl/libxl.h | 6 ++++++
tools/libxl/libxl_sched.c | 24 ++++++++++++++++++++++++
tools/libxl/libxl_types.idl | 1 +
3 files changed, 31 insertions(+)
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index a402236..cf8687a 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -210,6 +210,12 @@
#define LIBXL_HAVE_SCHED_RTDS 1
/*
+ * LIBXL_HAVE_SCHED_NULL indicates that the 'null' static scheduler
+ * is available.
+ */
+#define LIBXL_HAVE_SCHED_NULL 1
+
+/*
* libxl_domain_build_info has u.hvm.viridian_enable and _disable bitmaps
* of the specified width.
*/
diff --git a/tools/libxl/libxl_sched.c b/tools/libxl/libxl_sched.c
index 84d3837..d763b9a 100644
--- a/tools/libxl/libxl_sched.c
+++ b/tools/libxl/libxl_sched.c
@@ -178,6 +178,20 @@ static int sched_arinc653_domain_set(libxl__gc *gc, uint32_t domid,
return 0;
}
+static int sched_null_domain_set(libxl__gc *gc, uint32_t domid,
+ const libxl_domain_sched_params *scinfo)
+{
+ /* There aren't any domain-specific parameters to be set. */
+ return 0;
+}
+
+static int sched_null_domain_get(libxl__gc *gc, uint32_t domid,
+ libxl_domain_sched_params *scinfo)
+{
+ /* There aren't any domain-specific parameters to return. */
+ return 0;
+}
+
static int sched_credit_domain_get(libxl__gc *gc, uint32_t domid,
libxl_domain_sched_params *scinfo)
{
@@ -730,6 +744,9 @@ int libxl_domain_sched_params_set(libxl_ctx *ctx, uint32_t domid,
case LIBXL_SCHEDULER_RTDS:
ret=sched_rtds_domain_set(gc, domid, scinfo);
break;
+ case LIBXL_SCHEDULER_NULL:
+ ret=sched_null_domain_set(gc, domid, scinfo);
+ break;
default:
LOGD(ERROR, domid, "Unknown scheduler");
ret=ERROR_INVAL;
@@ -758,6 +775,7 @@ int libxl_vcpu_sched_params_set(libxl_ctx *ctx, uint32_t domid,
case LIBXL_SCHEDULER_CREDIT:
case LIBXL_SCHEDULER_CREDIT2:
case LIBXL_SCHEDULER_ARINC653:
+ case LIBXL_SCHEDULER_NULL:
LOGD(ERROR, domid, "per-VCPU parameter setting not supported for this scheduler");
rc = ERROR_INVAL;
break;
@@ -792,6 +810,7 @@ int libxl_vcpu_sched_params_set_all(libxl_ctx *ctx, uint32_t domid,
case LIBXL_SCHEDULER_CREDIT:
case LIBXL_SCHEDULER_CREDIT2:
case LIBXL_SCHEDULER_ARINC653:
+ case LIBXL_SCHEDULER_NULL:
LOGD(ERROR, domid, "per-VCPU parameter setting not supported for this scheduler");
rc = ERROR_INVAL;
break;
@@ -832,6 +851,9 @@ int libxl_domain_sched_params_get(libxl_ctx *ctx, uint32_t domid,
case LIBXL_SCHEDULER_RTDS:
ret=sched_rtds_domain_get(gc, domid, scinfo);
break;
+ case LIBXL_SCHEDULER_NULL:
+ ret=sched_null_domain_get(gc, domid, scinfo);
+ break;
default:
LOGD(ERROR, domid, "Unknown scheduler");
ret=ERROR_INVAL;
@@ -858,6 +880,7 @@ int libxl_vcpu_sched_params_get(libxl_ctx *ctx, uint32_t domid,
case LIBXL_SCHEDULER_CREDIT:
case LIBXL_SCHEDULER_CREDIT2:
case LIBXL_SCHEDULER_ARINC653:
+ case LIBXL_SCHEDULER_NULL:
LOGD(ERROR, domid, "per-VCPU parameter getting not supported for this scheduler");
rc = ERROR_INVAL;
break;
@@ -890,6 +913,7 @@ int libxl_vcpu_sched_params_get_all(libxl_ctx *ctx, uint32_t domid,
case LIBXL_SCHEDULER_CREDIT:
case LIBXL_SCHEDULER_CREDIT2:
case LIBXL_SCHEDULER_ARINC653:
+ case LIBXL_SCHEDULER_NULL:
LOGD(ERROR, domid, "per-VCPU parameter getting not supported for this scheduler");
rc = ERROR_INVAL;
break;
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index d970284..d42f6a1 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -191,6 +191,7 @@ libxl_scheduler = Enumeration("scheduler", [
(6, "credit2"),
(7, "arinc653"),
(8, "rtds"),
+ (9, "null"),
])
# Consistent with SHUTDOWN_* in sched.h (apart from UNKNOWN)
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[-- Attachment #1.1.2: tools-sched-add-support-for.patch --]
[-- Type: text/x-patch, Size: 4643 bytes --]
tools: sched: add support for 'null' scheduler
From: Dario Faggioli <dario.faggioli@citrix.com>
It being very very basic, also means this scheduler does
not need much support at the tools level (for now).
Basically, just the definition of the symbol of the
scheduler itself and a couple of stubs.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Stefano Stabellini <stefano@aporeto.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: George Dunlap <george.dunlap@citrix.com>
Cc: Julien Grall <julien.grall@arm.com>
---
tools/libxl/libxl.h | 6 ++++++
tools/libxl/libxl_sched.c | 24 ++++++++++++++++++++++++
tools/libxl/libxl_types.idl | 1 +
3 files changed, 31 insertions(+)
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index a402236..cf8687a 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -210,6 +210,12 @@
#define LIBXL_HAVE_SCHED_RTDS 1
/*
+ * LIBXL_HAVE_SCHED_NULL indicates that the 'null' static scheduler
+ * is available.
+ */
+#define LIBXL_HAVE_SCHED_NULL 1
+
+/*
* libxl_domain_build_info has u.hvm.viridian_enable and _disable bitmaps
* of the specified width.
*/
diff --git a/tools/libxl/libxl_sched.c b/tools/libxl/libxl_sched.c
index 84d3837..d763b9a 100644
--- a/tools/libxl/libxl_sched.c
+++ b/tools/libxl/libxl_sched.c
@@ -178,6 +178,20 @@ static int sched_arinc653_domain_set(libxl__gc *gc, uint32_t domid,
return 0;
}
+static int sched_null_domain_set(libxl__gc *gc, uint32_t domid,
+ const libxl_domain_sched_params *scinfo)
+{
+ /* There aren't any domain-specific parameters to be set. */
+ return 0;
+}
+
+static int sched_null_domain_get(libxl__gc *gc, uint32_t domid,
+ libxl_domain_sched_params *scinfo)
+{
+ /* There aren't any domain-specific parameters to return. */
+ return 0;
+}
+
static int sched_credit_domain_get(libxl__gc *gc, uint32_t domid,
libxl_domain_sched_params *scinfo)
{
@@ -730,6 +744,9 @@ int libxl_domain_sched_params_set(libxl_ctx *ctx, uint32_t domid,
case LIBXL_SCHEDULER_RTDS:
ret=sched_rtds_domain_set(gc, domid, scinfo);
break;
+ case LIBXL_SCHEDULER_NULL:
+ ret=sched_null_domain_set(gc, domid, scinfo);
+ break;
default:
LOGD(ERROR, domid, "Unknown scheduler");
ret=ERROR_INVAL;
@@ -758,6 +775,7 @@ int libxl_vcpu_sched_params_set(libxl_ctx *ctx, uint32_t domid,
case LIBXL_SCHEDULER_CREDIT:
case LIBXL_SCHEDULER_CREDIT2:
case LIBXL_SCHEDULER_ARINC653:
+ case LIBXL_SCHEDULER_NULL:
LOGD(ERROR, domid, "per-VCPU parameter setting not supported for this scheduler");
rc = ERROR_INVAL;
break;
@@ -792,6 +810,7 @@ int libxl_vcpu_sched_params_set_all(libxl_ctx *ctx, uint32_t domid,
case LIBXL_SCHEDULER_CREDIT:
case LIBXL_SCHEDULER_CREDIT2:
case LIBXL_SCHEDULER_ARINC653:
+ case LIBXL_SCHEDULER_NULL:
LOGD(ERROR, domid, "per-VCPU parameter setting not supported for this scheduler");
rc = ERROR_INVAL;
break;
@@ -832,6 +851,9 @@ int libxl_domain_sched_params_get(libxl_ctx *ctx, uint32_t domid,
case LIBXL_SCHEDULER_RTDS:
ret=sched_rtds_domain_get(gc, domid, scinfo);
break;
+ case LIBXL_SCHEDULER_NULL:
+ ret=sched_null_domain_get(gc, domid, scinfo);
+ break;
default:
LOGD(ERROR, domid, "Unknown scheduler");
ret=ERROR_INVAL;
@@ -858,6 +880,7 @@ int libxl_vcpu_sched_params_get(libxl_ctx *ctx, uint32_t domid,
case LIBXL_SCHEDULER_CREDIT:
case LIBXL_SCHEDULER_CREDIT2:
case LIBXL_SCHEDULER_ARINC653:
+ case LIBXL_SCHEDULER_NULL:
LOGD(ERROR, domid, "per-VCPU parameter getting not supported for this scheduler");
rc = ERROR_INVAL;
break;
@@ -890,6 +913,7 @@ int libxl_vcpu_sched_params_get_all(libxl_ctx *ctx, uint32_t domid,
case LIBXL_SCHEDULER_CREDIT:
case LIBXL_SCHEDULER_CREDIT2:
case LIBXL_SCHEDULER_ARINC653:
+ case LIBXL_SCHEDULER_NULL:
LOGD(ERROR, domid, "per-VCPU parameter getting not supported for this scheduler");
rc = ERROR_INVAL;
break;
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index d970284..d42f6a1 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -191,6 +191,7 @@ libxl_scheduler = Enumeration("scheduler", [
(6, "credit2"),
(7, "arinc653"),
(8, "rtds"),
+ (9, "null"),
])
# Consistent with SHUTDOWN_* in sched.h (apart from UNKNOWN)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-04-07 10:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-17 18:42 [PATCH 0/3] The 'null' Scheduler Dario Faggioli
2017-03-17 18:42 ` [PATCH 1/3] xen: sched: introduce the 'null' semi-static scheduler Dario Faggioli
2017-03-20 23:21 ` Stefano Stabellini
2017-03-21 8:26 ` Dario Faggioli
2017-03-27 10:31 ` George Dunlap
2017-03-27 10:48 ` George Dunlap
2017-04-06 14:43 ` Dario Faggioli
2017-04-06 15:07 ` Dario Faggioli
2017-03-17 18:43 ` [PATCH 2/3] xen: sched_null: support for hard affinity Dario Faggioli
2017-03-20 23:46 ` Stefano Stabellini
2017-03-21 8:47 ` Dario Faggioli
2017-03-17 18:43 ` [PATCH 3/3] tools: sched: add support for 'null' scheduler Dario Faggioli
2017-03-20 22:28 ` Stefano Stabellini
2017-03-21 17:09 ` Wei Liu
2017-03-27 10:50 ` George Dunlap
2017-04-06 10:49 ` Dario Faggioli
2017-04-06 13:59 ` George Dunlap
2017-04-06 15:18 ` Dario Faggioli
2017-04-07 9:42 ` Wei Liu
2017-04-07 10:05 ` Dario Faggioli [this message]
2017-04-07 10:13 ` Wei Liu
2017-03-20 22:23 ` [PATCH 0/3] The 'null' Scheduler Stefano Stabellini
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=1491559501.3287.4.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=julien.grall@arm.com \
--cc=stefano@aporeto.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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).