From: "Amit Chandra (amichand)" <amichand@cisco.com>
To: "m.szyprowski@samsung.com" <m.szyprowski@samsung.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-samsung-soc@vger.kernel.org"
<linux-samsung-soc@vger.kernel.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: dynamic reservation and allocation of physically contiguous memory using CMA
Date: Mon, 18 Jun 2018 18:23:08 +0000 [thread overview]
Message-ID: <DF0025E0-5C00-4566-82D2-F3599F206210@cisco.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1850 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 4947 bytes --]
next reply other threads:[~2018-06-18 18:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20180618182314epcas1p37a2b1ba6db9a829c07abf55ca0d3d50d@epcas1p3.samsung.com>
2018-06-18 18:23 ` Amit Chandra (amichand) [this message]
2018-06-19 11:45 ` Marek Szyprowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DF0025E0-5C00-4566-82D2-F3599F206210@cisco.com \
--to=amichand@cisco.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox