From: Dario Faggioli <dario.faggioli@citrix.com>
To: Meng Xu <xumengpanda@gmail.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Wei Liu <wei.liu@citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v2 2/5] libxl: enable per-VCPU extratime flag for RTDS
Date: Tue, 19 Sep 2017 11:23:01 +0200 [thread overview]
Message-ID: <1505812981.3483.8.camel@citrix.com> (raw)
In-Reply-To: <CAENZ-+=K2v0epvg_CbjxpQxhSoqrdkft8v=X8fYZAN+FCjp1BQ@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2677 bytes --]
On Fri, 2017-09-15 at 12:01 -0400, Meng Xu wrote:
> On Wed, Sep 13, 2017 at 8:16 PM, Dario Faggioli
> <dario.faggioli@citrix.com> wrote:
> >
> > > I'm ok with what it is in this patch, although I feel that we can
> > > kill the
> > > if (scinfo->extratime !=
> > > LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT)
> > > because LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT is -1.
> > >
> >
> > No, sorry, I don't understand what you mean here...
>
> I was thinking about the following code:
>
> 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;
> }
>
> This code can be changed to
> if (scinfo->extratime)
> sdom.flags |= XEN_DOMCTL_SCHEDRT_extra;
> else
> sdom.flags &= ~XEN_DOMCTL_SCHEDRT_extra;
>
> If the extratime uses default value (-1), we still set the extratime
> flag.
>
> That's why I feel we may kill the
> if (scinfo->extratime != LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT)
>
Mmm... Ok, I see it now. Well, this is of course all up to the tools'
maintainers.
What I think it would be valauble to ask ourself here is, can, at this
point, scinfo->extratime be equal to
XL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT?
And if it is, what does it mean, and what do we want to do?
I mean, if extratime is -1, it means that we've been called, without it
being touched by xl (although, remember that, as a library, libxl can
be linked to and called by other programs too, e.g., libvirt).
If you think that this is a serious programming bug, you can use
XL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT to check that, and raise an
assert.
If you think it's an API misuse, you can use it to check for that, and
return an error.
If you think it's just fine, you can do whatever you want to do as
default (which, AFAIUI, it's set the flag). In this case, it's probably
fine to ignore XL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT in actual code.
Although, I'd still put a reference to it in a comment, to explain
what's going on, and why we're doing things differently from budget and
period (since _their_ *_DEFAULT are checked).
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-09-19 9:23 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 ` [PATCH v2 2/5] libxl: enable per-VCPU extratime flag for RTDS Meng Xu
2017-09-01 16:03 ` Meng Xu
2017-09-14 0:16 ` Dario Faggioli
2017-09-15 16:01 ` Meng Xu
2017-09-19 9:23 ` Dario Faggioli [this message]
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=1505812981.3483.8.camel@citrix.com \
--to=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).