dynamic reservation and allocation of physically contiguous memory using CMA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi experts,

 

I had a question related to CMA. I have been trying to use the CMA infra to reserve and allocate physically contiguous memory dynamically at runtime.

I built a custom kernel based on linux-4.14.47 to invoke the cma initialization apis at runtime from kernel loadable module.

I invoke cma_declare_contiguous() followed by cma_init_reserved_areas().

cma_declare_contiguous throws no surprises and succeeds. The issue happens when cma_init_reserved_areas() is invoked post that.

Here is the kernel log snippet post that call:

 

Jun 15 03:30:31 ubuntu-quickstart kernel: [  384.593218] cma: cma_declare_contiguous(size 0x0000000200000000, base 0x0000000000000000, limit 0x0000000000000000 alignment 0x0000000000000000)

Jun 15 03:30:31 ubuntu-quickstart kernel: [  384.593228] cma: Reserved 8192 MiB at 0x0000001d4d000000

Jun 15 03:30:31 ubuntu-quickstart kernel: [  384.593345] BUG: Bad page state in process insmod  pfn:1d4d000

Jun 15 03:30:31 ubuntu-quickstart kernel: [  384.595758] page:ffffefc335340000 count:0 mapcount:-127 mapping:          (null) index:0x0

Jun 15 03:30:31 ubuntu-quickstart kernel: [  384.599193] flags: 0x57fffc000000000()

Jun 15 03:30:31 ubuntu-quickstart kernel: [  384.600751] raw: 057fffc000000000 0000000000000000 0000000000000000 00000000ffffff80

Jun 15 03:30:31 ubuntu-quickstart kernel: [  384.603946] raw: ffffefc335330020 ffffefc335350020 000000000000000a 0000000000000000

Jun 15 03:30:31 ubuntu-quickstart kernel: [  384.607152] page dumped because: nonzero mapcount

 

I am having a hard time trying to understand why the mapcount is less than 0 here. I figured this is happening in the call to __free_pages() from init_cma_reserved_pageblock().

Any pointers here would be really helpful. If I am missing any step for cma reservation, please do let me know.

 

Thanks in advance.

-Amit


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux