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

Re: [Xen-devel] [PATCH RFC] xen: prevent PVH Dom0 from having pages with more than one ref



On 13/06/14 11:23, Andrew Cooper wrote:
> On 13/06/14 10:12, Roger Pau Monne wrote:
>> With the current implementation of the Dom0 domain builder a PVH Dom0
>> ends up with pages that have 2 references, which means they are not
>> freed when Dom0 balloons memory down. This leads to those pages
>> not being freed in guest_remove_page, so they are leaked and the
>> memory accounting between Xen and Dom0 differs, because Dom0 OS
>> actually thinks they are freed, but d->tot_pages is not decreased.
>>
>> Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx>
>> Cc: Keir Fraser <keir@xxxxxxx>
>> Cc: Jan Beulich <jbeulich@xxxxxxxx>
>> Cc: Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>
>> ---
> 
> In which scenarios do pages get two refs, and why do you consider this
> to be valid?

AFAICT (given my little knowledge about the domain builder), those pages
have been allocated by alloc_domheap_pages earlier in the code, which
makes them already have 1 ref, and then this loop adds another ref to
them, which makes no sense to me.

The same happens for PV guests, but it doesn't seem to be a problem for
pure PV guests, and in fact removing this code for PV guests makes Xen
crash when the PV Dom0 boots. I would really appreciate if someone with
more knowledge on the domain builder code could comment on why this is
needed.

Roger.

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

 


Rackspace

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