[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen/malloc: handle correctly page allocation when align > size
>>> On 07.03.14 at 07:46, Julien Grall <julien.grall@xxxxxxxxxx> wrote: > When align is superior to size, we need to retrieve the order from > align during multiple page allocation. I guess it was the goal of the commit > fb034f42 "xmalloc: make close-to-PAGE_SIZE allocations more efficient". Oh, yes, of course it was. Without that the call is pointless. > Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> Albeit in fact the better change might be to simply use max(size, align) in the initializer of order - no idea why I didn't do it that way. Out of curiosity: I never expected this code path to be actually taken - what is it that you need this to work correctly? Jan > --- a/xen/common/xmalloc_tlsf.c > +++ b/xen/common/xmalloc_tlsf.c > @@ -531,7 +531,7 @@ static void *xmalloc_whole_pages(unsigned long size, > unsigned long align) > void *res, *p; > > if ( align > size ) > - get_order_from_bytes(align); > + order = get_order_from_bytes(align); > > res = alloc_xenheap_pages(order, 0); > if ( res == NULL ) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |