From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v3 3/6] xen: sched: clarify use cases of schedule_cpu_switch() Date: Fri, 30 Oct 2015 00:59:32 +0100 Message-ID: <1446163172.28782.100.camel@citrix.com> References: <20151029225158.25219.4625.stgit@Solace.station> <20151029230427.25219.2409.stgit@Solace.station> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5887810830358141284==" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zrx6c-0007Be-2t for xen-devel@lists.xenproject.org; Thu, 29 Oct 2015 23:59:42 +0000 In-Reply-To: <20151029230427.25219.2409.stgit@Solace.station> 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: George Dunlap , "xen-devel@lists.xenproject.org" , Jan Beulich List-Id: xen-devel@lists.xenproject.org --===============5887810830358141284== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-/mgEPatD6H2adxa6lL8G" --=-/mgEPatD6H2adxa6lL8G Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2015-10-30 at 00:04 +0100, Dario Faggioli wrote: > schedule_cpu_switch() is meant to be only used for moving > pCPUs from a cpupool to no cpupool, and from there back > to a cpupool, *not* to move them directly from one cpupool > to another. >=20 > This is something that is reflected in the way it is > implemented, and should be kept in mind when looking at > it. However, that is not that clear, by just the look of > it. >=20 > Make it more evident by: > - adding commentary and ASSERT()s; > - update the cpupool per-CPU variable (mapping pCPUs to > pools) directly in schedule_cpu_switch(), rather than > in various places in cpupool.c. >=20 > Signed-off-by: Dario Faggioli > Acked-by: Juergen Gross > BTW, Juergen, I had the whole series tested with the script below, for a few hourse, as per your suggestion to help confirming that this patch is actually correct, as it seems by just looking at the code. Since everything was fine, I added your Ack, as you said I could. Regards, Dario #!/bin/bash set -ex xl cpupool-cpu-remove Pool-0 0,2,4,6,8,10,12,14 xl cpupool-create name=3D\"Pool-even\" cpus=3D\"0,2,4,6,8,10,12,14\" sched= =3D\"credit\" xl cpupool-rename Pool-0 Pool-odd # Switch CPUs between pools function switchcpus() { while true; do for i in `seq 0 2 15`; do xl cpupool-cpu-remove Pool-even $i xl cpupool-cpu-add Pool-odd $i xl cpupool-list -c sleep $(($RANDOM%5)) xl cpupool-cpu-remove Pool-odd $i xl cpupool-cpu-add Pool-even $i done for i in `seq 1 2 15`; do echo $i xl cpupool-cpu-remove Pool-odd $i xl cpupool-cpu-add Pool-even $i xl cpupool-list -c sleep $(($RANDOM%5)) xl cpupool-cpu-remove Pool-even $i xl cpupool-cpu-add Pool-odd $i done xl cpupool-list -c done } # Moving a domain between pools function movedomain() { xl create vms/vm1.cfg pool=3D\"Pool-odd\" sleep 10 while true; do xl cpupool-migrate vm1 Pool-even sleep $(($RANDOM%10)) xl cpupool-migrate vm1 Pool-odd sleep $(($RANDOM%10)) done } # creating and destroying a domain function createdestroydomain() { while true; do xl create vms/vm2.cfg pool=3D\"Pool-odd\" xl list -c sleep $((10+$RANDOM%10)) xl destroy vm2 sleep $(($RANDOM%5)) xl create vms/vm2.cfg pool=3D\"Pool-even\" xl list -c sleep $((10+$RANDOM%10)) xl destroy vm2 done } switchcpus & movedomain & createdestroydomain & --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-/mgEPatD6H2adxa6lL8G 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 iEYEABECAAYFAlYysuUACgkQk4XaBE3IOsSxiwCfS3Y12Vz+7NVMOEXqORRPjy8r TOkAmwbHPDkphSfo8FhYQbjAhcqNNfUG =/GVD -----END PGP SIGNATURE----- --=-/mgEPatD6H2adxa6lL8G-- --===============5887810830358141284== 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 --===============5887810830358141284==--