lkml.org 
[lkml]   [2014]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectCMA alignment question
Hi all,

The alignment in cma_alloc() is done w.r.t. the bitmap. This is a
problem when, for example:

- a device requires 16M (order 12) alignment
- the CMA region is not 16 M aligned

In such a case, can result with the CMA region starting at, say,
0x2f800000 but any allocation you make from there will be aligned from
there. Requesting an allocation of 32 M with 16 M alignment, will
result in an allocation from 0x2f800000 to 0x31800000, which doesn't
work very well if your strange device requires 16M alignment.

This doesn't have the behavior I would expect, which would be for the
allocation to be aligned w.r.t. the start of memory. I realize that
aligning the CMA region is an option, but don't see why cma_alloc()
aligns to the start of the CMA region. Is there a good reason for
having cma_alloc() alignment work this way?

Thanks and regards,
Gregory


\
 
 \ /
  Last update: 2014-11-04 22:41    [W:0.101 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site