From: Marek Szyprowski Date: Mon, 27 Aug 2012 18:27:19 +0000 (+0200) Subject: mm: cma: fix alignment requirements for contiguous regions X-Git-Tag: upstream/snapshot3+hdmi~6734^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ce9bf1f4785dab0598a19a7fcb0733a18193e4e;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git mm: cma: fix alignment requirements for contiguous regions 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 Acked-by: Michal Nazarewicz --- 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);