Commit 7ce9bf1f4785dab0598a19a7fcb0733a18193e4e
1 parent
fea7a08acb
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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 <m.szyprowski@samsung.com> CC: Michal Nazarewicz <mina86@mina86.com> Acked-by: Michal Nazarewicz <mina86@mina86.com>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
drivers/base/dma-contiguous.c
... | ... | @@ -250,7 +250,7 @@ |
250 | 250 | return -EINVAL; |
251 | 251 | |
252 | 252 | /* Sanitise input arguments */ |
253 | - alignment = PAGE_SIZE << max(MAX_ORDER, pageblock_order); | |
253 | + alignment = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order); | |
254 | 254 | base = ALIGN(base, alignment); |
255 | 255 | size = ALIGN(size, alignment); |
256 | 256 | limit &= ~(alignment - 1); |