CMA question

Greg KH greg at kroah.com
Sun Feb 26 11:31:52 EST 2017


On Sun, Feb 26, 2017 at 05:29:05PM +0100, Johannes Thoma wrote:
> Dear Kernel hackers,
> 
> As far as I understood CMA (contiguous memory allocation) memory is used 
> for other purposes as long it isn't requested via cma_alloc() by a 
> driver. cma_alloc then tries to free the memory by relocating it and 
> returns the contiguous area.
> 
> I have a case where cma_alloc() sometimes fails to relocate the memory 
> which causes my driver (a GPU driver) to fail starting up (the driver is 
> started when the system is running for a while). Is there a way to 
> prevent the CM allocator to use the memory for any other purpose? Or 
> should I better use another mechanism to allocate  contiguous memory at 
> boot time (is there a framework for doing so)?

If at boot time you don't have enough memory, something is really wrong
and your driver shouldn't work, that's to be expected.  Try starting it
earlier in the boot process.

Do you have a pointer to your driver anywhere so we could see if you are
doing something odd with the cma interface?

thanks,

greg k-h



More information about the Kernelnewbies mailing list