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

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



On 10/08/16 23:02, Samuel Thibault wrote:
> 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.

I don't mind changing it, while it seems rather unlikely that the
maximum number of frames added in one chunk would ever exceed 32768.

> 
> Otherwise it looks good,
> 
> Reviewed-By: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>

Thanks,

Juergen


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

 


Rackspace

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