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

Re: [Xen-devel] Converting heap page_infos to contiguous virtual



On 13/07/16 20:44, Boris Ostrovsky wrote:
> I would like to clear a bunch of Xen heap pages at once (i.e. not
> page-by-page).
>
> Greatly simplifying things, let's say I grab (in common/page_alloc.c)
>     pg = page_list_remove_head(&heap(node, zone, order)
>
> and then
>
>     mfn_t mfn =
> _mfn(page_to_mfn(pg));                                        
>     char *va = mfn_to_virt(mfn_x(mfn));
>     memset(va, 0, 4096 * (1 << order));
>
>
> Would it be valid to this?

In principle, yes.  The frame_table is in order.

However, mfn_to_virt() will blow up for RAM above the 5TB boundary.  You
need to map_domain_page() to get a mapping.

>  Do I need to account for the PDX hole?

Jan is probably the best person to ask about this, but I am failure sure
there are lurking dragons here.

PDX compression is used to reduce the size of the frametable when there
are large unused ranges of mfns.  Without paying attention to the PDX
shift, you don't know where the discontinuities lie.

However, because the PDX shift is an aligned power of two, there are
likely to be struct page_info*'s in the frame_table which don't point at
real RAM, and won't have a virtual mapping even in the directmap.

~Andrew

_______________________________________________
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®.