From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: [RFC/RFT][PATCH 2 of 3] Remove VCPU pausing while adjusting domain scheduling parameters. Date: Wed, 23 Nov 2011 16:09:22 +0100 Message-ID: <1322060962.30168.20.camel@Abyss> References: <1322060131.30168.15.camel@Abyss> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1264720008416452509==" Return-path: In-Reply-To: <1322060131.30168.15.camel@Abyss> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: George Dunlap , Juergen Gross , Keir Fraser List-Id: xen-devel@lists.xenproject.org --===============1264720008416452509== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-iUixRJLLusaLlDYRB4m1" --=-iUixRJLLusaLlDYRB4m1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Pausing all the non-current VCPUs of a domain while changing its scheduling parameters is dangerous (what if two VCPUs try to pause all the other VCPUs but themselves at the same time?). Moreover, it does not appear to be needed, since: - races are (or should be) avoided within each pluggable scheduler by means of proper locking; - changes in values using during actual scheduling are (or should be) prevented by runq locking. Just remove it. Signed-off-by: Dario Faggioli diff -r 6b5e2eb81706 xen/common/schedule.c --- a/xen/common/schedule.c Wed Nov 23 15:09:14 2011 +0100 +++ b/xen/common/schedule.c Wed Nov 23 15:20:28 2011 +0100 @@ -1005,7 +1005,6 @@ int sched_id(void) /* Adjust scheduling parameter for a given domain. */ long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op) { - struct vcpu *v; long ret; =20 if ( (op->sched_id !=3D DOM2OP(d)->sched_id) || @@ -1013,27 +1012,11 @@ long sched_adjust(struct domain *d, stru (op->cmd !=3D XEN_DOMCTL_SCHEDOP_getinfo)) ) return -EINVAL; =20 - /* - * Most VCPUs we can simply pause. If we are adjusting this VCPU then - * concurrent updates shall be prevented within the actual pluggable - * scheduler. - */ - - for_each_vcpu ( d, v ) - { - if ( v !=3D current ) - vcpu_pause(v); - } - + /* NB: the pluggable scheduler code needs to take care + * of locking by itself. */ if ( (ret =3D SCHED_OP(DOM2OP(d), adjust, d, op)) =3D=3D 0 ) TRACE_1D(TRC_SCHED_ADJDOM, d->domain_id); =20 - for_each_vcpu ( d, v ) - { - if ( v !=3D current ) - vcpu_unpause(v); - } - return ret; } =20 --=20 <> (Raistlin Majere) ------------------------------------------------------------------- Dario Faggioli, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) PhD Candidate, ReTiS Lab, Scuola Superiore Sant'Anna, Pisa (Italy) --=-iUixRJLLusaLlDYRB4m1 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.11 (GNU/Linux) iEYEABECAAYFAk7NDKIACgkQk4XaBE3IOsSxLwCgh2gB8Ci33mMrIK8rSZ47h7s7 SfsAnRbJDt855eGyTrffJzKMwUdFvyxB =16Lq -----END PGP SIGNATURE----- --=-iUixRJLLusaLlDYRB4m1-- --===============1264720008416452509== 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.xensource.com http://lists.xensource.com/xen-devel --===============1264720008416452509==--