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

Re: [Xen-devel] [PATCH v4 1/4] xen: introduce a helper to allocate non-contiguous memory



>>> On 07.05.15 at 17:32, <tim@xxxxxxx> wrote:
> At 16:22 +0100 on 07 May (1431015746), Tim Deegan wrote:
>> At 16:29 +0200 on 07 May (1431016173), Roger Pau Monne wrote:
>> > The allocator uses independent calls to alloc_heap_pages in order to get 
> the
>> > desired amount of memory and then maps all the independent physical
>> > addresses into a contiguous virtual address space.
>> > 
>> > In order to keep track of this regions a red-black tree is used.
>> 
>> On x86, at least, the vmap apparatus should be able to tell you what
>> MFN is mapped by using the linear map to look at the l1e.  On ARM, it
>> looks like we could walk the xen pagetable trie from xen_second[] for
>> the same effect.
>> 
>> So I'd suggest adding a vmap_to_mfn() and usign that instead of
>> building the red-black tree. 
> 
> Also: does this need a clear_page() somewhere to scrub the allocation?
> If not here, I think it's needed in patches 2 and 3 where you're
> replacing xzalloc (unless you're sure that the loop will write every
> byte of the allocation, in which case xzalloc was overkill).

Just like we have xmalloc() and xzalloc() I think we should have
vmalloc() and vzalloc().

Jan


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