cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
alain.guillemot
Visitor
Visitor
4,738 Views
Registered: ‎10-29-2010

Using alloc_bootmem for huge DMA buffer

I plane to use DMA on my project, but with huge buffer size more than 128Koctets, with os Linux.
SO currently with Linux 2.6.24 pro5024 and xapp1129 note i could test successfully example provide with xapp1129.
Now i want to increase buffer size, in Linux device driver 3 there is note relative to huge buffer for device driver, such buffer should be allocated at kernel boot up with alloc_bootmem function.
So in xll_example_init function i test a call to alloc_bootmem (buffer size set to 0X400 for test), but kernel now crash whith a panic due to failure during allocation.

0 Kudos
2 Replies
mamisadegh3
Explorer
Explorer
4,727 Views
Registered: ‎09-19-2010

Dear Sir,

 

I can not understand why we should use Boot Time Memory Allocation feature of the Linux kernel for creating a 128Kbytes or ever a 1MBytes buffer for our DMA transactions?

 

Why dont we simply allocate the required memory in our "kernel Mode driver" code, or even in our user level application?

 

Regards

Mohammad Sadegh Sadri.

 

0 Kudos
borja_mrtnz
Contributor
Contributor
4,458 Views
Registered: ‎07-08-2008

 

I'm am working on the same issue. If I use large buffer sizes (1MB) kmalloc gets "page allocation failure" after some attemps due to memory fragmentation.

 

Did you solve it with alloc_bootmem? The Scatter-Gather DMA implemented in xapp1129 should transfer large amounts of data with small linked buffers, do not?

 

Thank you.

0 Kudos