Physically contiguous (DMA) memory allocation
Hello,
I'm working on a driver for one of our devices with some heavy DMA memory requirements - 20 - 30 MB in all. As a loadable module (perfect for development stage), the driver frequently causes annoying OOM problems.
Is there a quick solution to this problem, like increasing the size of the physically contiguous page pool (like in Windows NT and some other OS'es :-( )? (Is it a good idea to make this one of the future enhancements to Linux?) Or should I write a driver loaded at boot time grabbing the required memory pages and allocating them to my loadable driver when requested?
Your suggestion is very much appreciated.
Regards,
Anthony Dominic Truong.
Disclaimer: The information contained in this transmission, including any attachments, may contain confidential information of Matsushita Avionics Systems Corporation. This transmission is intended only for the use of the addressee(s) listed above. Unauthorized review, dissemination or other use of the information contained in this transmission is strictly prohibited. If you have received this transmission in error or have reason to believe you are not authorized to receive it, please notify the sender by return email and promptly delete the transmission.
Quoted 7 lines · Anthony Truong
Is there a quick solution to this problem, like increasing the size of the physically contiguous page pool (like in Windows NT and some other OS'es :-( )? (Is it a good idea to make this one of the future enhancements to Linux?) Or should I write a driver loaded at boot time grabbing the required memory pages and allocating them to my loadable driver when requested?
Your suggestion is very much appreciated.
Without source code its hard to tell what you are doing but all allocations made with the pci_* API in Linux are contiguous. If your hardware requires a single contiguous 30Mb chunk then you have a problem and will need to allocate at boot time.