From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 3 of 8] xen: let the (credit) scheduler know about `node affinity` Date: Tue, 9 Oct 2012 11:21:42 +0100 Message-ID: <1349778102.3610.55.camel@Abyss> References: <5073F431.1020500@ts.fujitsu.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2116320985017608953==" Return-path: In-Reply-To: <5073F431.1020500@ts.fujitsu.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: Juergen Gross Cc: Marcus Granado , Andre Przywara , Ian Campbell , Anil Madhavapeddy , George Dunlap , Andrew Cooper , Ian Jackson , xen-devel@lists.xen.org, Jan Beulich , Daniel De Graaf , Matt Wilson List-Id: xen-devel@lists.xenproject.org --===============2116320985017608953== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-ncrXDeHAw5vv2oIqgQGO" --=-ncrXDeHAw5vv2oIqgQGO Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2012-10-09 at 11:53 +0200, Juergen Gross wrote:=20 > > diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c > > --- a/xen/common/sched_credit.c > > +++ b/xen/common/sched_credit.c > ... > > static int > > _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t= commit) > > { > > - cpumask_t cpus; > > + cpumask_t cpus, start_cpus; > > cpumask_t idlers; > > cpumask_t *online; > > + struct csched_dom *sdom =3D CSCHED_DOM(vc->domain); > > struct csched_pcpu *spc =3D NULL; > > int cpu; > > > > /* > > - * Pick from online CPUs in VCPU's affinity mask, giving a > > - * preference to its current processor if it's in there. > > + * Pick an online CPU from the&& of vcpu-affinity and node-affini= ty > > + * masks (if not empty, in which case only the vcpu-affinity mask = is > > + * used). Also, try to give a preference to its current processor = if > > + * it's in there. > > */ > > online =3D cpupool_scheduler_cpumask(vc->domain->cpupool); > > cpumask_and(&cpus, online, vc->cpu_affinity); > > - cpu =3D cpumask_test_cpu(vc->processor,&cpus) > > + cpumask_and(&start_cpus,&cpus, sdom->node_affinity_cpumask); > > + if ( unlikely(cpumask_empty(&start_cpus)) ) > > + cpumask_copy(&start_cpus,&cpus); > > + cpu =3D cpumask_test_cpu(vc->processor,&start_cpus) > > ? vc->processor > > - : cpumask_cycle(vc->processor,&cpus); > > + : cpumask_cycle(vc->processor,&start_cpus); > > ASSERT( !cpumask_empty(&cpus)&& cpumask_test_cpu(cpu,&cpus) ); >=20 > Shouldn't the ASSERT be changed to start_cpus, too? >=20 Well, it seems it definitely should, and I seem to have missed that!=20 Thanks a lot, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-ncrXDeHAw5vv2oIqgQGO 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.12 (GNU/Linux) iEUEABECAAYFAlBz+rYACgkQk4XaBE3IOsRtngCgo3DRGWzjJ4jicURE71BfNpNN cTcAmMNAw4PxuAgNK/hWDTxDzmrHizQ= =Xt9i -----END PGP SIGNATURE----- --=-ncrXDeHAw5vv2oIqgQGO-- --===============2116320985017608953== 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 --===============2116320985017608953==--