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

Re: [Xen-devel] [PATCH RFC 1/2] xen/page_alloc: Add size_align parameter to provide MFNs which are size aligned.



On Wed, Nov 30, 2016 at 02:30:41AM -0700, Jan Beulich wrote:
> >>> On 30.11.16 at 05:39, <konrad@xxxxxxxxxx> wrote:
> > This is to support the requirement that exists in PV dom0
> > when doing DMA requests:
> > 
> > "dma_alloc_coherent()
> > [...]
> > The CPU virtual address and the DMA address are both guaranteed to be
> > aligned to the smallest PAGE_SIZE order which is greater than or equal
> > to the requested size.  This invariant exists (for example) to guarantee
> > that if you allocate a chunk which is smaller than or equal to 64
> > kilobytes, the extent of the buffer you receive will not cross a 64K
> > boundary."
> 
> So I'm having trouble understanding what it is that actually needs
> fixing / changing here: Any order-N allocation will be order-N-aligned
> already. Is your caller perhaps simply not passing in a large enough
> order? And changing alloc_heap_pages(), which guarantees the
> requested alignment already anyway (after all it takes an order
> input, not a size one), looks completely pointless regardless of what
> extra requirements you may want to put on the exchange hypercall.

The page_alloc.c code walks through different order pages. Which means
that if it can't find one within the requested order pages it will
go one up (and so on). Eventually that means you do get the requested
order pages, but they are not guaranteed to be order aligned (as they
may be order aligned to a higher value).

> 
> Jan
> 

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