From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v4 14/15] xl: enable for specifying node-affinity in the config file Date: Mon, 2 Dec 2013 19:22:54 +0100 Message-ID: <1386008574.5338.223.camel@Solace> References: <20131122183332.11200.20231.stgit@Solace> <20131122185831.11200.85261.stgit@Solace> <1385567619.30237.39.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0247042301726628250==" Return-path: In-Reply-To: <1385567619.30237.39.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Marcus Granado , Keir Fraser , Jan Beulich , Li Yechen , George Dunlap , Andrew Cooper , Juergen Gross , Ian Jackson , xen-devel@lists.xen.org, Matt Wilson , Justin Weaver , Elena Ufimtseva List-Id: xen-devel@lists.xenproject.org --===============0247042301726628250== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-vDBjk8sIwvG+2MXnTKH0" --=-vDBjk8sIwvG+2MXnTKH0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On mer, 2013-11-27 at 15:53 +0000, Ian Campbell wrote: > On Fri, 2013-11-22 at 19:58 +0100, Dario Faggioli wrote: > > +static int *parse_config_cpumap_list(XLU_ConfigList *cpus, > > + libxl_bitmap *cpumap, > > + int max_vcpus) >=20 > I assume this is pure motion/refactoring? Or do I need to read it? >=20 It indeed it motion/refactoring, and so it is in v5. > > +{ > > + int i, n_cpus =3D 0; > > + int *to_pcpu; > > + const char *buf; > > + > > + if (libxl_cpu_bitmap_alloc(ctx, cpumap, 0)) { > > + fprintf(stderr, "Unable to allocate cpumap\n"); > > + exit(1); > > + } > > + > > + /* Prepare the array for single vcpu to pcpu mappings */ > > + to_pcpu =3D xmalloc(sizeof(int) * max_vcpus); > > + memset(to_pcpu, -1, sizeof(int) * max_vcpus); > > + > > + /* > > + * Idea here is to let libxl think all the domain's vcpus > > + * have cpu affinity with all the pcpus on the list. Doing > > + * that ensures memory is allocated on the proper NUMA nodes. > > + * It is then us, here in xl, that matches each single vcpu > > + * to its pcpu (and that's why we need to stash such info in > > + * the to_pcpu array now) after the domain has been created. > > + * This way, we avoid having to pass to libxl some big array > > + * hosting the single mappings. > > + */ > > + libxl_bitmap_set_none(cpumap); > > + while ((buf =3D xlu_cfg_get_listitem(cpus, n_cpus)) !=3D NULL) { > > + i =3D atoi(buf); > > + if (!libxl_bitmap_cpu_valid(cpumap, i)) { > > + fprintf(stderr, "cpu %d illegal\n", i); > > + exit(1); > > + } > > + libxl_bitmap_set(cpumap, i); > > + if (n_cpus < max_vcpus) > > + to_pcpu[n_cpus] =3D i; > > + n_cpus++; > > + } > > + > > + return to_pcpu; > > +} > > + > > +static void parse_config_cpumap_string(const char *buf, libxl_bitmap *= cpumap) >=20 > Likewise this is also motion/refactoring, correct? >=20 Same here. Thanks and Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-vDBjk8sIwvG+2MXnTKH0 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 v1.4.15 (GNU/Linux) iEYEABECAAYFAlKcz/4ACgkQk4XaBE3IOsTcnwCgnfi2JJUzAvNj9DHUUX5317ya K/wAn3Y5tWy7yD+mXLs57GIrRbEn4QeV =qYkv -----END PGP SIGNATURE----- --=-vDBjk8sIwvG+2MXnTKH0-- --===============0247042301726628250== 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 --===============0247042301726628250==--