From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v2 1/2] xen: sched: reorganize cpu_disable_scheduler() Date: Mon, 20 Jul 2015 13:59:45 +0200 Message-ID: <1437393585.5036.8.camel@citrix.com> References: <20150717133013.29612.53960.stgit@Solace.station> <20150717133554.29612.14835.stgit@Solace.station> <55ACDE7D.50108@suse.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5322052724015060299==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZH9k6-0002oa-6z for xen-devel@lists.xenproject.org; Mon, 20 Jul 2015 12:00:22 +0000 In-Reply-To: <55ACDE7D.50108@suse.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 --===============5322052724015060299== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-KLw6xK3pFicCNNl5zkyF" --=-KLw6xK3pFicCNNl5zkyF Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2015-07-20 at 13:41 +0200, Juergen Gross wrote: > On 07/17/2015 03:35 PM, Dario Faggioli wrote: > > @@ -644,25 +673,66 @@ 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; > > + } > > + > > + /* If it is on cpu, we must send it away. */ > > + if ( unlikely(system_state =3D=3D SYS_STATE_suspend) ) > > + { > > + /* > > + * If we are doing a shutdown/suspend, it is not neces= sary to > > + * ask the scheduler to chime in. In fact: > > + * * there is no reason for it: the end result we are= after > > + * is just 'all the vcpus on the boot pcpu, and no = vcpu > > + * anywhere else', so let's just go for it; > > + * * it's wrong, for cpupools with only non-boot pcpu= s, as > > + * the scheduler would always fail to send the vcpu= s away > > + * from the last online (non boot) pcpu! > > + * > > + * Therefore, in the shutdown/suspend case, we just pi= ck up > > + * one (still) online pcpu. Note that, at this stage, = all > > + * domains (including dom0) have been paused already, = so we > > + * do not expect any vcpu activity at all. > > + */ > > + cpumask_andnot(&online_affinity, &cpu_online_map, > > + cpumask_of(cpu)); > > + BUG_ON(cpumask_empty(&online_affinity)); > > + /* > > + * As boot cpu is, usually, pcpu #0, using cpumask_fir= st() > > + * will make us converge quicker. > > + */ > > + new_cpu =3D cpumask_first(&online_affinity); > > + vcpu_move_nosched(v, new_cpu); >=20 > Shouldn't there be a vcpu_schedule_unlock_irqrestore() ? >=20 I'm sure I put one there, as I was sure that it was there the last time I inspected the patch before hitting send. But I see that it's not there now, so I must have messed up when formatting the patch, or something like that. :-( It's really really weird, as I forgot it during development, and then the system was hanging, and then I added it, and that's why I'm sure I did have it in place... but perhaps I fat fingered some stgit command which made it disappear. In any case, sorry for this. I will re-test (just to be sure) and re-send (and this time I'll triple check!!) 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) --=-KLw6xK3pFicCNNl5zkyF 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 iEYEABECAAYFAlWs4rEACgkQk4XaBE3IOsRvhgCffy4xVLEDurB7KjeiVBpZP5zc bc4AoIqzrRtGEbUIL1Tc5rELWaVtKj8t =hL5/ -----END PGP SIGNATURE----- --=-KLw6xK3pFicCNNl5zkyF-- --===============5322052724015060299== 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 --===============5322052724015060299==--