From patchwork Fri Mar 7 06:46:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 25864 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 432EC20560 for ; Fri, 7 Mar 2014 06:48:22 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wn1sf13760953obc.5 for ; Thu, 06 Mar 2014 22:48:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:cc:subject :precedence:list-id:list-unsubscribe:list-post:list-help :list-subscribe:mime-version:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive :content-type:content-transfer-encoding; bh=uTFXv7O7xrKTi8zud5Uwqh8kVWwSdOcDah7fTtPrzkY=; b=Q2GJRVOCKetGcip/z9LRIvRFyftEjihbkds2/iAlPoTb7f4m8n5Tk9f9T9/IO8E2F2 lLreqMHMF/5XklUkx+V94hxpoOlqqtvl9gWM0BctZNJhDdb+C1/jikh6BtbFykVu+ZUu /jSD5XEEnJsb5R3HJiHFkGMGY4NSDbb9kC6v6jfJeSVtslDIFwfdFH0sIGZz8P9mn/4D hBHz9mgpnRB+T5nxJ18e6qelGPWTSY8aG+MaH43lECb+h8J43GUw+kb3UcOBa7/pnFYg yJpmVKsu08Gv6JTbmYpNWboXn+lWN0JiC4dK693nwOoDMoyo/AJZ1a864Sd4ztCrcc78 zX0Q== X-Gm-Message-State: ALoCoQmVWTQ/Gg/3S3YLrYshHKbBKNtQiEpKXsDuE9ntSTUbaJP3Bua8Pt/85VIk7E1+rfKuVAR3 X-Received: by 10.182.98.230 with SMTP id el6mr7209497obb.10.1394174901812; Thu, 06 Mar 2014 22:48:21 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.85.133 with SMTP id n5ls1003570qgd.64.gmail; Thu, 06 Mar 2014 22:48:21 -0800 (PST) X-Received: by 10.58.37.67 with SMTP id w3mr8839328vej.22.1394174901703; Thu, 06 Mar 2014 22:48:21 -0800 (PST) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id us10si1834036vcb.134.2014.03.06.22.48.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Mar 2014 22:48:21 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id oy12so3758832veb.18 for ; Thu, 06 Mar 2014 22:48:21 -0800 (PST) X-Received: by 10.220.159.4 with SMTP id h4mr8713554vcx.1.1394174901620; Thu, 06 Mar 2014 22:48:21 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp93816vck; Thu, 6 Mar 2014 22:48:21 -0800 (PST) X-Received: by 10.43.180.133 with SMTP id pe5mr24631icc.71.1394174901051; Thu, 06 Mar 2014 22:48:21 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id ax8si3331921igc.18.2014.03.06.22.48.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 06 Mar 2014 22:48:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WLoYC-0005Fi-Ah; Fri, 07 Mar 2014 06:46:32 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WLoYB-0005Fd-7O for xen-devel@lists.xenproject.org; Fri, 07 Mar 2014 06:46:31 +0000 Received: from [85.158.139.211:51141] by server-16.bemta-5.messagelabs.com id 91/82-05060-64B69135; Fri, 07 Mar 2014 06:46:30 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-15.tower-206.messagelabs.com!1394174788!8250386!1 X-Originating-IP: [209.85.220.50] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.9.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8920 invoked from network); 7 Mar 2014 06:46:29 -0000 Received: from mail-pa0-f50.google.com (HELO mail-pa0-f50.google.com) (209.85.220.50) by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 7 Mar 2014 06:46:29 -0000 Received: by mail-pa0-f50.google.com with SMTP id kq14so3750568pab.23 for ; Thu, 06 Mar 2014 22:46:27 -0800 (PST) X-Received: by 10.66.228.37 with SMTP id sf5mr19848707pac.19.1394174787869; Thu, 06 Mar 2014 22:46:27 -0800 (PST) Received: from localhost.localdomain (z88l218.static.ctm.net. [202.175.88.218]) by mx.google.com with ESMTPSA id oz7sm29145652pbc.41.2014.03.06.22.46.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Mar 2014 22:46:26 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Fri, 7 Mar 2014 14:46:03 +0800 Message-Id: <1394174763-6992-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.8.5.3 Cc: Julien Grall , keir@xen.org, jbeulich@suse.com Subject: [Xen-devel] [PATCH] xen/malloc: handle correctly page allocation when align > size X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: 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". Signed-off-by: Julien Grall Reviewed-by: Jan Beulich --- xen/common/xmalloc_tlsf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c index d3bdfa7..c957119 100644 --- 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 )