| From dhobsong@igel.co.jp Mon Oct 29 00:53:58 2012 |
| From: Damian Hobson-Garcia <dhobsong@igel.co.jp> |
| Date: Mon, 29 Oct 2012 16:51:09 +0900 |
| Subject: [PATCH v2 52/58] mm: cma: fix alignment requirements for contiguous regions |
| To: greg@kroah.com, laurent.pinchart@ideasonboard.com, horms@verge.net.au |
| Cc: ltsi-dev@lists.linuxfoundation.org, dhobsong@igel.co.jp |
| Message-ID: <1351497075-32717-53-git-send-email-dhobsong@igel.co.jp> |
| |
| |
| From: Marek Szyprowski <m.szyprowski@samsung.com> |
| |
| 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 <m.szyprowski@samsung.com> |
| CC: Michal Nazarewicz <mina86@mina86.com> |
| Acked-by: Michal Nazarewicz <mina86@mina86.com> |
| (cherry picked from commit 7ce9bf1f4785dab0598a19a7fcb0733a18193e4e) |
| |
| Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp> |
| --- |
| 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); |
| -- |
| 1.7.5.4 |
| |