[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-4.0-testing] Allow max_pages to be set to less than tot_pages
# HG changeset patch # User Keir Fraser <keir@xxxxxxx> # Date 1287923177 -3600 # Node ID aabda497d83f7c289d58c77c321c77bf1f432930 # Parent 06feba5976f3ad23d5cd73156e5dbbaa5237535a Allow max_pages to be set to less than tot_pages The memory allocation code sometimes needs to enforce that a guest that's been told to balloon down isn't going to expand further (because it's still executing a previous balloon-up operation). That means being able to set the desired max_pages even before the balloon driver has brought tot_pages down to the right level. Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx> Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> xen-unstable changeset: 22279:2208a036f8d9 xen-unstable date: Sun Oct 24 13:13:04 2010 +0100 --- xen/common/domctl.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff -r 06feba5976f3 -r aabda497d83f xen/common/domctl.c --- a/xen/common/domctl.c Wed Oct 20 13:35:07 2010 +0100 +++ b/xen/common/domctl.c Sun Oct 24 13:26:17 2010 +0100 @@ -764,11 +764,13 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc new_max = op->u.max_mem.max_memkb >> (PAGE_SHIFT-10); spin_lock(&d->page_alloc_lock); - if ( new_max >= d->tot_pages ) - { - d->max_pages = new_max; - ret = 0; - } + /* + * NB. We removed a check that new_max >= current tot_pages; this means + * that the domain will now be allowed to "ratchet" down to new_max. In + * the meantime, while tot > max, all new allocations are disallowed. + */ + d->max_pages = new_max; + ret = 0; spin_unlock(&d->page_alloc_lock); max_mem_out: _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |