[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 17/18] mini-os: add support for ballooning up



Juergen Gross, on Fri 05 Aug 2016 19:36:01 +0200, wrote:
> +#define N_BALLOON_FRAMES 64
> +static unsigned long balloon_frames[N_BALLOON_FRAMES];
> +
> +int balloon_up(unsigned long n_pages)
> +{
> +    unsigned long page, pfn;
> +    int rc;
> +    struct xen_memory_reservation reservation = {
> +        .address_bits = 0,
> +        .extent_order = 0,
> +        .domid        = DOMID_SELF
> +    };
> +
> +    if ( n_pages > nr_max_pages - nr_mem_pages )
> +        n_pages = nr_max_pages - nr_mem_pages;
> +    if ( n_pages > N_BALLOON_FRAMES )
> +        n_pages = N_BALLOON_FRAMES;
> +
> +    /* Resize alloc_bitmap if necessary. */
> +    if ( alloc_bitmap_size * 8 < nr_mem_pages + n_pages )

To be on the safe side, I'd say use a while here, even if the value of
N_BALLOON_FRAMES is so that there'll always be one iteration ATM.

Otherwise it looks good,

Reviewed-By: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.