From: Dan Magenheimer Subject: Re: Proposed new "memory capacity claim" hypercall/feature Date: Thu, 1 Nov 2012 08:51:45 -0700 (PDT) Message-ID: References: <60d00f38-98a3-4ec2-acbd-b49dafaada56@default> <20121029223555.GA24388@ocelot.phlegethon.org> <1351736001.18330.139.camel@Solace> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1351736001.18330.139.camel@Solace> 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 , Tim Deegan Cc: Olaf Hering , "Keir (Xen.org)" , Ian Campbell , Konrad Wilk , George Dunlap , Kurt Hackel , George Shuklin , xen-devel@lists.xen.org, Zhigang Wang , Ian Jackson List-Id: xen-devel@lists.xenproject.org > From: Dario Faggioli [mailto:raistlin@linux.it] > Subject: Re: Proposed new "memory capacity claim" hypercall/feature > > On Mon, 2012-10-29 at 22:35 +0000, Tim Deegan wrote: > > At 10:06 -0700 on 29 Oct (1351505175), Dan Magenheimer wrote: > > > In the case of a dying domain, a XENMEM_release operation > > > is implied and must be executed by the hypervisor. > > > > > > Ideally, the quantity of unclaimed memory for each domain and > > > for the system should be query-able. This may require additional > > > memory_op hypercalls. > > > > > > I'd very much appreciate feedback on this proposed design! > > > > As I said, I'm not opposed to this, though even after reading through > > the other thread I'm not convinced that it's necessary (except in cases > > where guest-controlled operations are allowed to consume unbounded > > memory, which frankly gives me the heebie-jeebies). > > > Let me also ask something. > > Playing with NUMA systems I've been in the situation where it would be > nice to know not only how much free memory we have in general, but how > much free memory there is in a specific (set of) node(s), and that in > many places, from the hypervisor, to libxc, to top level toolstack. > > Right now I ask this to Xen, but that is indeed prone to races and > TOCTOU issues if we allow for domain creation and ballooning TOCTOU... hadn't seen that term before, but I agree it describes the problem succinctly. Thanks, I will begin using that now! > (tmem/paging/...) to happen concurrently between themselves and between > each other (as noted in the long thread that preceded this one). > > Question is, the "claim" mechanism you're proposing is by no means NUMA > node-aware, right? I hadn't thought about NUMA, but I think the claim mechanism could be augmented to attempt to stake a claim on a specified node, or on any node that has sufficient memory. AFAICT this might complicate the arithmetic a bit but should work. Let me prototype the NUMA-ignorant mechanism first though... Dan