From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: Xen crashing when killing a domain with no VCPUs allocated Date: Mon, 21 Jul 2014 14:57:25 +0200 Message-ID: <1405947445.17850.1.camel@Solace> References: <53C920DD.6060300@linaro.org> <1405701560.14973.1.camel@kazak.uk.xensource.com> <53C982FF.7070608@linaro.org> <53CCEC64.7040304@eu.citrix.com> <53CCFD9D.2050502@linaro.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0481947546523872396==" Return-path: In-Reply-To: <53CCFD9D.2050502@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: jgross@suse.com, Ian Campbell , Stefano Stabellini , George Dunlap , Tim Deegan , george.dunlap@citrix.com, xen-devel List-Id: xen-devel@lists.xenproject.org --===============0481947546523872396== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-2QKzRhkXhbM0Py4CkqKa" --=-2QKzRhkXhbM0Py4CkqKa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On lun, 2014-07-21 at 12:46 +0100, Julien Grall wrote: > On 07/21/2014 11:33 AM, George Dunlap wrote: > > On 07/18/2014 09:26 PM, Julien Grall wrote: > >> diff --git a/xen/common/schedule.c b/xen/common/schedule.c > >> index e9eb0bc..c44d047 100644 > >> --- a/xen/common/schedule.c > >> +++ b/xen/common/schedule.c > >> @@ -311,7 +311,7 @@ int sched_move_domain(struct domain *d, struct > >> cpupool *c) > >> } > >> /* Do we have vcpus already? If not, no need to update > >> node-affinity */ > >> - if ( d->vcpu ) > >> + if ( d->vcpu && d->vcpu[0] !=3D NULL ) > >> domain_update_node_affinity(d); > >=20 > > Overall it seems like those checks for the existence of cpus should be > > moved into domain_update_node_affinity(). The ASSERT() there I think i= s > > just a sanity check to make sure we're not getting a ridiculous result > > out of our calculation; but of course if there actually are no vcpus, > > it's not ridiculous at all. > >=20 > > One solution might be to change the ASSERT to > > ASSERT(!cpumask_empty(dom_cpumask) || !d->vcpu || !d->vcpu[0]). Then w= e > > could probably even remove the d->vcpu conditional when calling it. >=20 > This solution also works for me. Which change do you prefer? >=20 FWIW, I think I like changing the ASSERT() in domain_update_node_affinity(), as George suggested (and perhaps with the reordering Andrew suggested) better. Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-2QKzRhkXhbM0Py4CkqKa 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 iEYEABECAAYFAlPNDjUACgkQk4XaBE3IOsQOcACgq311WWlf7XTu06ZX629R2KJu XDsAn1+IcXBjB29+d0VPyZwXryHBVk8a =k68c -----END PGP SIGNATURE----- --=-2QKzRhkXhbM0Py4CkqKa-- --===============0481947546523872396== 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 --===============0481947546523872396==--