xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Meng Xu <xumengpanda@gmail.com>
Cc: Chong Li <chong.li@wustl.edu>, Wei Liu <wei.liu2@citrix.com>,
	Sisu Xi <xisisu@gmail.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"mengxu@cis.upenn.edu" <mengxu@cis.upenn.edu>,
	Jan Beulich <jbeulich@suse.com>, Chong Li <lichong659@gmail.com>,
	Dagaen Golomb <dgolomb@seas.upenn.edu>
Subject: Re: [PATCH v1 4/4] xl: enabling XL to set per-VCPU parameters of a domain for RTDS scheduler
Date: Thu, 14 May 2015 16:39:38 +0200	[thread overview]
Message-ID: <1431614378.2978.160.camel@citrix.com> (raw)
In-Reply-To: <CAENZ-+kdL9O9J7Z06K_tMpWV2MzKMbMjp9wfrvzVTkxCV8BC_A@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1716 bytes --]

On Thu, 2015-05-14 at 10:24 -0400, Meng Xu wrote:
> > @@ -5744,6 +5749,7 @@ static int sched_rtds_pool_output(uint32_t poolid)
> >      return 0;
> >  }
> >
> > +
> >  static int sched_default_pool_output(uint32_t poolid)
> >  {
> >      char *poolname;
> > @@ -6120,38 +6126,87 @@ int main_sched_rtds(int argc, char **argv)
> >  {
> >      const char *dom = NULL;
> >      const char *cpupool = NULL;
> > -    int period = 0; /* period is in microsecond */
> > -    int budget = 0; /* budget is in microsecond */
> > +
> > +    int vcpus[LIBXL_XEN_LEGACY_MAX_VCPUS]; /* indices of VCPUs that change */
> > +    int periods[LIBXL_XEN_LEGACY_MAX_VCPUS]; /* period is in microsecond */
> > +    int budgets[LIBXL_XEN_LEGACY_MAX_VCPUS]; /* budget is in microsecond */
> 
> 
> We know this is not good (ugly), but not sure about the best approach
> to do this. Basically, if users tries to input several pairs of period
> and budget, what is the best way to hold those data? Should we just
> increase the array size by using something like remalloc when we find
> more parameters are inputted?
> 
In xl and/or libxl, a couple of remalloc() are not a problem. there are
very few hot paths in them, and this is certainly not one of them.

In xl, we have xrealloc() defined for that purpose, in libxl,
GCNEW_ARRAY() and GCREALLOC_ARRAY(), so really, no big deal. It may
might sense to put think at something to avoid realloc()-ing 17 times by
1 element (like doubling the allocation at each time, and then, of
course, only use the actually filled elements).

In any case, the problem here is not (only) the static array, it is the
use of LIBXL_XEN_LEGACY_MAX_VCPUS.

Regards,
Dario

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2015-05-14 14:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-07 17:05 [PATCH v1 0/4] Enabling XL to set per-VCPU parameters of a domain for RTDS scheduler Chong Li
2015-05-07 17:05 ` [PATCH v1 1/4] xen: enabling " Chong Li
2015-05-08  7:49   ` Jan Beulich
2015-05-10 22:04     ` Chong Li
2015-05-11  6:57       ` Jan Beulich
2015-05-14 22:27         ` Chong Li
2015-05-15 14:42           ` Dario Faggioli
2015-05-11 13:11   ` Dario Faggioli
2015-05-14 22:15     ` Chong Li
2015-05-07 17:05 ` [PATCH v1 2/4] libxc: " Chong Li
2015-05-11 13:27   ` Dario Faggioli
2015-05-07 17:05 ` [PATCH v1 3/4] libxl: " Chong Li
2015-05-11 14:06   ` Dario Faggioli
2015-05-15 15:24     ` Chong Li
2015-05-15 23:09       ` Dario Faggioli
2015-05-12 10:01   ` Dario Faggioli
2015-05-15 16:35     ` Chong Li
2015-05-15 23:02       ` Dario Faggioli
2015-05-22 17:57     ` Chong Li
2015-05-07 17:05 ` [PATCH v1 4/4] xl: " Chong Li
2015-05-14 14:24   ` Meng Xu
2015-05-14 14:39     ` Dario Faggioli [this message]
2015-05-14 14:43       ` Meng Xu
2015-05-11  9:56 ` [PATCH v1 0/4] Enabling " Dario Faggioli
2015-05-14 17:08   ` Chong Li

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=1431614378.2978.160.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=chong.li@wustl.edu \
    --cc=dgolomb@seas.upenn.edu \
    --cc=george.dunlap@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=lichong659@gmail.com \
    --cc=mengxu@cis.upenn.edu \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xisisu@gmail.com \
    --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).