From: Dario Faggioli <dario.faggioli@citrix.com>
To: George Dunlap <george.dunlap@citrix.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <stefano@aporeto.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Julien Grall <julien.grall@arm.com>,
Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH 3/3] tools: sched: add support for 'null' scheduler
Date: Thu, 6 Apr 2017 12:49:35 +0200 [thread overview]
Message-ID: <1491475775.18721.14.camel@citrix.com> (raw)
In-Reply-To: <8c57725d-4bb7-7bd2-c74f-24486531ce94@citrix.com>
[-- Attachment #1.1: Type: text/plain, Size: 2585 bytes --]
On Mon, 2017-03-27 at 11:50 +0100, George Dunlap wrote:
> On 17/03/17 18:43, Dario Faggioli wrote:
> > --- 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)
> > +{
> > + /* The null scheduler doesn't take any domain-specific
> > parameters. */
> > + return 0;
> > +}
> > +
> > +static int sched_null_domain_get(libxl__gc *gc, uint32_t domid,
> > + libxl_domain_sched_params *scinfo)
> > +{
> > + /* The null scheduler doesn't have any domain-specific
> > parameters. */
> > + return ERROR_INVAL;
> > +}
>
> Why the different return value? Why not return either INVAL or
> SUCCESS
> for both?
>
Because domain_set() is called by libxl_domain_sched_params_set(),
which is in turn called unconditionally within libxl__build_post(),
with the purpose of setting the scheduling parameters chosen by the
user during domain creation.
If that fails (I've tried that), domain creation fails too. So either
it returns success, or we'd have to modify (at least)
liblx__build_post(), teaching it about acceptable failures.
OTOH, we indeed could return success for domain_get() too, for the sake
of having the two above functions return the same. But I really think
that call should fail, as an indication to the callers that they won't
get the value of any parameter for this scheduler.
The behavior achieved by this patch is the same one already in place
for ARINC653, with the difference that sched_arinc653_sched_get() is
not implemented, which means it is libxl_domain_sched_params_get() that
fails, if LIBXL_SCHED_ARINC653 is used. That's an option too, but then
libxl will also print "Unknown scheduler", which is not really correct
(not even in the ARINC case, actually!).
So, having evaluated all the choices, the asymmetric behavior above
seems the best one to me. And I'll add a comment to explain the
situation.
Thanks and regards,
Dario
--
<<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.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-06 10:49 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 [this message]
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
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=1491475775.18721.14.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).