From patchwork Fri Aug 24 07:20:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10914 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A5B1E23E53 for ; Fri, 24 Aug 2012 07:20:49 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 6D957A18737 for ; Fri, 24 Aug 2012 07:20:32 +0000 (UTC) Received: by iafj25 with SMTP id j25so580630iaf.11 for ; Fri, 24 Aug 2012 00:20:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:date:message-id:x-mailer:x-brightmail-tracker:x-tm-as-mml :cc:subject:x-beenthere:x-mailman-version:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:sender :errors-to:x-gm-message-state; bh=RdKKytklpHKeNVrw3F/Yyhvfl98bCzHllbFcZPAfrgA=; b=fv7US1YST5N8B0nWOfVrFtmCnjG7bztAcR5IsOd6I5S5GdnW4vQqgwziZViJinNnY+ /84tMYPmHhxo6KmdWNqNkkelfwyoASiv8x0ro6rteAhkG0RVvRXaJJjrMUPsPkV91Ja3 8iovmjSj2wqLDKgdy9EtksOAYX5Zjkec+Ua1A1P7J3EW+Oz/3S47NWLjClnHci1QHisF UawXGLC7cWOQC8VST7h1PXdrEEUUSe1Dtlb8bNW474dJZjUcW3dnE0oBK9VcXeuFo+QR Tjtgzy/9Hcp35JvIEPVas/ecTY3ieGSXQZ/qsvvKlTsTLUpiKx1Jowfhx7rZNJbruo72 vUPQ== Received: by 10.50.207.106 with SMTP id lv10mr1146938igc.0.1345792848431; Fri, 24 Aug 2012 00:20:48 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp303877igc; Fri, 24 Aug 2012 00:20:47 -0700 (PDT) Received: by 10.216.255.18 with SMTP id i18mr2288858wes.45.1345792846541; Fri, 24 Aug 2012 00:20:46 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id x78si13177702wei.137.2012.08.24.00.20.44; Fri, 24 Aug 2012 00:20:46 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1T4oCA-0002oN-9x; Fri, 24 Aug 2012 07:20:42 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1T4oC8-0002ks-I8 for linaro-mm-sig@lists.linaro.org; Fri, 24 Aug 2012 07:20:40 +0000 Received: from epcpsbgm2.samsung.com (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M99000SF0E3D3N0@mailout1.samsung.com> for linaro-mm-sig@lists.linaro.org; Fri, 24 Aug 2012 16:20:36 +0900 (KST) X-AuditID: cbfee61b-b7faf6d00000476a-9c-50372b4403a3 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 27.C0.18282.44B27305; Fri, 24 Aug 2012 16:20:36 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M99006LS0E37510@mmp2.samsung.com> for linaro-mm-sig@lists.linaro.org; Fri, 24 Aug 2012 16:20:36 +0900 (KST) From: Marek Szyprowski To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linaro-mm-sig@lists.linaro.org Date: Fri, 24 Aug 2012 09:20:10 +0200 Message-id: <1345792810-5152-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.10 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDJMWRmVeSWpSXmKPExsVy+t9jQV0XbfMAgxnTJCy+XHnI5MDocfvf Y+YAxigum5TUnMyy1CJ9uwSujENnVrMXtHBWnLq1h62B8Rh7FyMnh4SAicShf7/YIGwxiQv3 1gPZXBxCAtMZJd4+vAHlrGWS+LauCayKTcBQouttF5gtIhAm8fjjV7AiZoH3jBIrJ+9iBEkI C3hLdDbcZgWxWQRUJU7uecMCYvMKuEuc2/qJBWKdvMTT+31sExi5FzAyrGIUTS1ILihOSs81 0itOzC0uzUvXS87P3cQI9uMz6R2MqxosDjEKcDAq8fDuaDELEGJNLCuuzD3EKMHBrCTCO/8x UIg3JbGyKrUoP76oNCe1+BCjNAeLkjgvf59hgJBAemJJanZqakFqEUyWiYNTqoFxYslVly/N yndbiq2afj3csyBGdl+VxUmNLXYcS99tqP0tOnG3dMXBo9/WiUyOWnZmy3G7wt1nlBOU/z8v F3CdLNb4teSNwGmnbWYX98iqyswwvc02aZlForeA743jvS/r7C3u2s98kHjh672F4XLHX03x eKuVzTdLYUOn6UbjSQpuvhPDbKerKLEUZyQaajEXFScCAGmpqBzfAQAA X-TM-AS-MML: No Cc: Arnd Bergmann , Mel Gorman , Michal Nazarewicz , Kyungmin Park , Andrew Morton Subject: [Linaro-mm-sig] [PATCH] mm: cma: fix alignment requirements for contiguous regions X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQkRjSA2gMTUvxNVaeBYlYq2BbA7ZLuafyL3Fa3Omr7nIr65jp48MdGpYv8p42fYTAX/BEXZ Contiguous Memory Allocator requires each of its regions to be aligned in such a way that it is possible to change migration type for all pageblocks holding it and then isolate page of largest possible order from the buddy allocator (which is MAX_ORDER-1). This patch relaxes alignment requirements by one order, because MAX_ORDER alignment is not really needed. Signed-off-by: Marek Szyprowski CC: Michal Nazarewicz --- drivers/base/dma-contiguous.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c index 78efb03..34d94c7 100644 --- a/drivers/base/dma-contiguous.c +++ b/drivers/base/dma-contiguous.c @@ -250,7 +250,7 @@ int __init dma_declare_contiguous(struct device *dev, unsigned long size, return -EINVAL; /* Sanitise input arguments */ - alignment = PAGE_SIZE << max(MAX_ORDER, pageblock_order); + alignment = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order); base = ALIGN(base, alignment); size = ALIGN(size, alignment); limit &= ~(alignment - 1);