From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli 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 Message-ID: <1431614378.2978.160.camel@citrix.com> References: <1431018326-3239-1-git-send-email-chong.li@wustl.edu> <1431018326-3239-5-git-send-email-chong.li@wustl.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4334004226958831552==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Meng Xu Cc: Chong Li , Wei Liu , Sisu Xi , George Dunlap , "xen-devel@lists.xen.org" , "mengxu@cis.upenn.edu" , Jan Beulich , Chong Li , Dagaen Golomb List-Id: xen-devel@lists.xenproject.org --===============4334004226958831552== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-JWKUTgAfakSp2QQJZbTl" --=-JWKUTgAfakSp2QQJZbTl Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 =3D NULL; > > const char *cpupool =3D NULL; > > - int period =3D 0; /* period is in microsecond */ > > - int budget =3D 0; /* budget is in microsecond */ > > + > > + int vcpus[LIBXL_XEN_LEGACY_MAX_VCPUS]; /* indices of VCPUs that ch= ange */ > > + int periods[LIBXL_XEN_LEGACY_MAX_VCPUS]; /* period is in microseco= nd */ > > + int budgets[LIBXL_XEN_LEGACY_MAX_VCPUS]; /* budget is in microseco= nd */ >=20 >=20 > 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? >=20 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 --=-JWKUTgAfakSp2QQJZbTl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlVUs6oACgkQk4XaBE3IOsQ5KwCfURt5zB4JS3QQU5Sw5EYv8n0x dnoAn08TMdvrroMtG0bCNrnApH8WxjpV =mb9A -----END PGP SIGNATURE----- --=-JWKUTgAfakSp2QQJZbTl-- --===============4334004226958831552== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============4334004226958831552==--