From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH] xen/malloc: handle correctly page allocation when align > size Date: Sun, 09 Mar 2014 15:25:13 +0000 Message-ID: <531C87D9.5080900@linaro.org> References: <1394174763-6992-1-git-send-email-julien.grall@linaro.org> <5319A8280200007800121DA6@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WMfbJ-0006nf-D7 for xen-devel@lists.xenproject.org; Sun, 09 Mar 2014 15:25:17 +0000 Received: by mail-wg0-f41.google.com with SMTP id n12so7455793wgh.0 for ; Sun, 09 Mar 2014 08:25:15 -0700 (PDT) In-Reply-To: <5319A8280200007800121DA6@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel@lists.xenproject.org, keir@xen.org List-Id: xen-devel@lists.xenproject.org On 07/03/14 10:06, Jan Beulich wrote: >>>> On 07.03.14 at 07:46, Julien Grall 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 > > Reviewed-by: Jan Beulich > > 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. I can send a new version of this page to use max. > Out of curiosity: I never expected this code path to be actually > taken - what is it that you need this to work correctly? I was looking to the code to decide if the best solution is to use xmalloc or alloc_xenheap_pages directly. -- Julien Grall