Re: CMA alignment question

2014-11-06 Thread Michal Nazarewicz
On Thu, Nov 06 2014, Weijie Yang wrote: > I agree the current code doesn't handle this issue properly. > However, I prefer to add specific usage to CMA interface rather than > modify the cma code, Because the latter hide the issue and could waste > memory. cma_alloc should handle whatever alignme

Re: CMA alignment question

2014-11-05 Thread Weijie Yang
On Thu, Nov 6, 2014 at 6:01 AM, Michal Nazarewicz wrote: >> On Tue, Nov 04 2014, Gregory Fong wrote: >>> 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 >

Re: CMA alignment question

2014-11-05 Thread Michal Nazarewicz
> On Tue, Nov 04 2014, Gregory Fong wrote: >> 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 On Wed, Nov 05 2014, Weijie Yang wrote: > I think the device dri

Re: CMA alignment question

2014-11-04 Thread Weijie Yang
On Wed, Nov 5, 2014 at 12:18 PM, Gregory Fong wrote: > On Tue, Nov 4, 2014 at 2:27 PM, Michal Nazarewicz wrote: >> On Tue, Nov 04 2014, Gregory Fong wrote: >>> The alignment in cma_alloc() is done w.r.t. the bitmap. This is a >>> problem when, for example: >>> >>> - a device requires 16M (order

Re: CMA alignment question

2014-11-04 Thread Gregory Fong
On Tue, Nov 4, 2014 at 2:27 PM, Michal Nazarewicz wrote: > On Tue, Nov 04 2014, Gregory Fong wrote: >> 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 >> >> I

Re: CMA alignment question

2014-11-04 Thread Michal Nazarewicz
On Tue, Nov 04 2014, Gregory Fong wrote: > 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, > 0

CMA alignment question

2014-11-04 Thread Gregory Fong
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, 0x2f80 but any allocation you make from the