From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 3/4] xen: sched: reorganize cpu_disable_scheduler() Date: Thu, 9 Jul 2015 12:24:53 +0200 Message-ID: <1436437493.22672.308.camel@citrix.com> References: <20150703152743.23194.15530.stgit@Solace.station> <20150703154930.23194.20319.stgit@Solace.station> <559BB4FC.1070106@suse.com> <1436368416.22672.220.camel@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7615014374662125003==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZD90t-000505-Kn for xen-devel@lists.xenproject.org; Thu, 09 Jul 2015 10:25:07 +0000 In-Reply-To: <1436368416.22672.220.camel@citrix.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: George Dunlap , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org --===============7615014374662125003== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-yCwyyre1F7om1KbGwDT4" --=-yCwyyre1F7om1KbGwDT4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey, 1 thing... On Wed, 2015-07-08 at 17:13 +0200, Dario Faggioli wrote: > On Tue, 2015-07-07 at 13:16 +0200, Juergen Gross wrote: > > > @@ -645,25 +675,72 @@ int cpu_disable_scheduler(unsigned int cpu) > > > cpumask_setall(v->cpu_hard_affinity); > > > } > > > > > > - if ( v->processor =3D=3D cpu ) > > > + if ( v->processor !=3D cpu ) > > > { > > > - set_bit(_VPF_migrating, &v->pause_flags); > > > + /* This vcpu is not on cpu, so we can move on. */ > > > vcpu_schedule_unlock_irqrestore(lock, flags, v); > > > - vcpu_sleep_nosync(v); > > > - vcpu_migrate(v); > > > + continue; > > > } > > > - else > > > - vcpu_schedule_unlock_irqrestore(lock, flags, v); > > > > > > /* > > > - * A vcpu active in the hypervisor will not be migratabl= e. > > > - * The caller should try again after releasing and reaqu= iring > > > - * all locks. > > > + * If we're here, it means that the vcpu is on cpu. Let'= s see how > > > + * it's best to send it away, depending on whether we ar= e shutting > > > + * down/suspending, or doing cpupool manipulations. > > > */ > > > - if ( v->processor =3D=3D cpu ) > > > - ret =3D -EAGAIN; > > > - } > > > + set_bit(_VPF_migrating, &v->pause_flags); > > > + vcpu_schedule_unlock_irqrestore(lock, flags, v); > > > + vcpu_sleep_nosync(v); > > > + > > > + /* > > > + * In case of shutdown/suspend, it is not necessary to a= sk the > > > + * scheduler to chime in. In fact: > > > + * * there is no reason for it: the end result we are a= fter is > > > + * just 'all the vcpus on the boot pcpu, and no vcpu = anywhere > > > + * else', so let's just go for it; > > > + * * it's wrong, when dealing a cpupool with only non-b= oot pcpus, > > > + * as the scheduler will always fail to send the vcpu= s away > > > + * from the last online (non boot) pcpu! > >=20 > > I'd add a comment that in shutdown/suspend case all domains are being > > paused, so we can be active in dom0/Pool-0 only. > >=20 > Sure, I'll add this. >=20 ...while putting such a comment together, I'm realizing that I'm not sure about what you meant, or what you wanted the comment itself to express. I mean, it is certainly true that all domains are being paused (they've been paused already, actually), but that include Dom0 too. Also, we are in Xen, in stop_machine context, so I'm not sure what you meant either with "we can be active in dom0/Pool-0 only". So, I'm adding a line about things being paused. If you think I should say anything more than that, let me know. 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) --=-yCwyyre1F7om1KbGwDT4 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 iEYEABECAAYFAlWeS/wACgkQk4XaBE3IOsTwuwCgi5f8YYKQY02iCdXh4r5znx7L 6bUAoITH1I5grcylnTxDhK/i8Gna5u8r =ORvb -----END PGP SIGNATURE----- --=-yCwyyre1F7om1KbGwDT4-- --===============7615014374662125003== 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 --===============7615014374662125003==--