Because XENMEM_maximum_reservation is rumored to change meaning in the future, this patch adds a third amount-of-memory operation to HYPERVISOR_memory_op() - XENMEM_maximum_memory. This should make it possible to simply specify the maximum amount of memory a guest will have in /etc/xen/<guest> instead of having to pass it on the kernel commandline. A next step would be to split out the maxmem values into two different ones in the guest config file and the tools, but I''m not quite sure what name to use there... Signed-off-by: Rik van Riel <riel@redhat.com> -- All Rights Reversed _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Glauber de Oliveira Costa
2006-Nov-22 10:40 UTC
[Xen-devel] Re: [PATCH] make ballooning up to maxmem work
> case XENMEM_current_reservation: > case XENMEM_maximum_reservation: > + case XENMEM_maximum_memory: > if ( copy_from_guest(&domid, arg, 1) ) > return -EFAULT;This still makes use of d->max_pages in return. Isn''t it supposed to change in the future too? IIRC, according to Keir, max_pages will track the _current_ number of pages, differing from tot_pages only in a brief timeframe in which you balloon, but tot_pages was not yet updated. -- Glauber de Oliveira Costa Red Hat Inc. "Free as in Freedom" _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Nov-22 11:18 UTC
Re: [Xen-devel] Re: [PATCH] make ballooning up to maxmem work
On 22/11/06 10:40, "Glauber de Oliveira Costa" <gcosta@redhat.com> wrote:>> case XENMEM_current_reservation: >> case XENMEM_maximum_reservation: >> + case XENMEM_maximum_memory: >> if ( copy_from_guest(&domid, arg, 1) ) >> return -EFAULT; > > This still makes use of d->max_pages in return. Isn''t it supposed to > change in the future too? IIRC, according to Keir, max_pages will track > the _current_ number of pages, differing from tot_pages only in a brief > timeframe in which you balloon, but tot_pages was not yet updated.This adds a level of indirection at least, but really we may as well implement the XENMEM_memory_map hypercall. Then there is no guest modification required. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Glauber de Oliveira Costa
2006-Nov-22 12:47 UTC
Re: [Xen-devel] Re: [PATCH] make ballooning up to maxmem work
On Wed, Nov 22, 2006 at 11:18:39AM +0000, Keir Fraser wrote:> > > > On 22/11/06 10:40, "Glauber de Oliveira Costa" <gcosta@redhat.com> wrote: > > >> case XENMEM_current_reservation: > >> case XENMEM_maximum_reservation: > >> + case XENMEM_maximum_memory: > >> if ( copy_from_guest(&domid, arg, 1) ) > >> return -EFAULT; > > > > This still makes use of d->max_pages in return. Isn''t it supposed to > > change in the future too? IIRC, according to Keir, max_pages will track > > the _current_ number of pages, differing from tot_pages only in a brief > > timeframe in which you balloon, but tot_pages was not yet updated. > > This adds a level of indirection at least, but really we may as well > implement the XENMEM_memory_map hypercall. Then there is no guest > modification required.We may need guest modifications anyway, since currently no actions are performed if the memory_map call does not return ENOSYS. -- Glauber de Oliveira Costa Red Hat Inc. "Free as in Freedom" _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel