From: Dan Magenheimer Subject: Re: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall Date: Thu, 15 Nov 2012 10:00:22 -0800 (PST) Message-ID: References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default> <50A4D12002000078000A8C68@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <50A4D12002000078000A8C68@nat28.tlf.novell.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: Jan Beulich Cc: Keir Fraser , TimDeegan , Konrad Wilk , Zhigang Wang , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org > From: Jan Beulich [mailto:JBeulich@suse.com] > Sent: Thursday, November 15, 2012 3:25 AM > To: Dan Magenheimer > Cc: xen-devel@lists.xen.org; KonradWilk; Zhigang Wang; Keir Fraser; TimDeegan > Subject: Re: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall Hi Jan -- Thanks for the quick review! Mostly fixed for v3 but a couple things: > > + * Claimed memory is considered unavailable unless the request > > + * is made by a domain with sufficient unclaimed pages. > > + */ > > + if ( (total_unclaimed_pages + request > > > + total_avail_pages + tmem_freeable_pages()) && > > + (d == NULL || d->unclaimed_pages < request) ) > > + goto not_found; > > The treatment of d being NULL certainly needs further thought: > Is it really better to fulfill the claim and fail some (perhaps > important) _xmalloc()? Ideally, allocation in the presence of existing claims should behave as if the claiming domains had actually already allocated the unclaimed-amount-of-memory. So I'd argue that enforcing the claim should be sacrosanct here. > Also, I'm missing a mechanism by which the tools could find out > how much unclaimed memory is available, in order to determine > (if in use) how much memory needs to be ballooned out of Dom0. OK. I'm not certain if this will be useful on a per-domain basis as well but, for completeness, I will also add unclaimed_pages into xc_dominfo etc (which causes a bump in XEN_DOMCTL_INTERFACE_VERSION). > Similarly, but perhaps of lower priority, there is no integration > with the low-mem handling. I'd also consider this lower priority as Olaf and Andre have argued that the claim mechanism is not needed for sharing/paging so the two mechanisms may not be used together, at least for the foreseeable future. So I plan to skip this, unless you change your mind and consider it a showstopper for acceptance. > Finally, there still are a number of formatting issues. Hmmm... I found one I think. Is there an equivalent to checkpatch for hypervisor code? If you see any formatting issues in v3, please call them out explicitly as I am sincerely trying to avoid them. Thanks, Dan