From: Dan Magenheimer Subject: Re: domain creation vs querying free memory (xend and xl) Date: Tue, 2 Oct 2012 11:17:27 -0700 (PDT) Message-ID: <1bc0b089-fb3e-4fcb-88db-bdc188a887a8@default> References: <53b8c758-2675-42a7-b63f-4f9ad0006d84@default> <50646FBF.9000501@gmail.com> <1348848483.3153.23.camel@Abyss> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1348848483.3153.23.camel@Abyss> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli , George Shuklin Cc: Ian Jackson , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org (Rats, thought I sent this out yesterday...) > From: Dario Faggioli [mailto:raistlin@linux.it] > Sent: Friday, September 28, 2012 10:08 AM > To: George Shuklin > Cc: xen-devel@lists.xen.org > Subject: Re: [Xen-devel] domain creation vs querying free memory (xend and xl) > > On Thu, 2012-09-27 at 19:24 +0400, George Shuklin wrote: > > not sure about xl/xm, but xapi performs one start at time, so there is > > no race between domains for memory or other resources. Oops, sorry, I missed this part of the thread because I wasn't directly cc'ed and am behind on my xen-devel reading... > IIRC, xl has a vary coarse grain locking mechanism in place for domain > creation too. As a result of that, you shouldn't be able to create two > domains at the same time, which should be enough for preventing the > situation described in the original e-mail for occurring. > > Looking at acquire_lock() and release_lock() (and at where they are > called) in xl code should clarify whether or not that is enough to > actually avoid the race (which I think it is, but I might be wrong :-D). This sounds like a pretty serious limitation, especially if it applies to migration as well as creation (or a combination)... I hope it is not a regression from xm to xl. For example, suppose a data center is trying to do a planned downtime for machine X by force-migrating all guests to machine Y. It sounds like xl would serialize this? > That being said, there still is the room for races, although not wrt > domain creation, as, for instance, there isn't any synchronization > between creation and ballooning, which both manipulate memory. So, maybe > thinking about some kind of reservation-based/transactional mechanism at > some level might make actual sense. Which is mostly the reason I am interested ;-) though solving the superset of my problem is probably a good thing as well. Dan > Unfortunately, I've no idea about how xm works in that respect. > > Hope this at least help clarifying the situation a bit. :-) > > Thanks and Regards, > Dario > > -- > <> (Raistlin Majere) > ----------------------------------------------------------------- > Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli > Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) > >