From: "Chan Kim" <ckim@etri.re.kr>
To: <kernelnewbies@kernelnewbies.org>
Subject: RE: How can I reserve contiguous mem alloc region?
Date: Tue, 3 Jan 2023 17:48:16 +0900 [thread overview]
Message-ID: <004901d91f50$1f9d2f60$5ed78e20$@etri.re.kr> (raw)
In-Reply-To:
Hi, all,
I was able to get cma-reserved region by adding CONFIG_DMA_CMA=y.
This is the result.
Memory: 233708K/1048576K available (3200K kernel code, 386K rwdata, 808K
rodata, 7808K init, 105K bss, 28436K reserved, 786432K cma-reserved)
Thanks!
Chan Kim
>-----Original Message-----
>From: Chan Kim <ckim@etri.re.kr>
>Sent: Tuesday, January 3, 2023 2:36 PM
>To: kernelnewbies@kernelnewbies.org
>Subject: How can I reserve contiguous mem alloc region?
>
>Hello kernel experts and users,
>
>I wanted to test cma-allocator in linux (5.15.68).
>So I added linux,cma node in the /reserved-memory node like this.
>
> reserved-memory {
> #address-cells = <2>;
> #size-cells = <2>;
> ranges;
>
> axpu_reserved_mem: axpursvd@90000000 {
> no-map;
> reg = <0x0 0xc0000000 0x0 0x8000000>;
> };
>
> linux,cma {
> compatible = "shared-dma-pool";
> reusable;
> size = <0 0x30000000>;
> alloc-ranges = <0 0x90000000 0 0x30000000>;
> linux,cma-default;
> };
> };
>
>BTW, this test was done on qemu arm64 machine and there is only 1GB ram
>(from 0x80000000 ~ 0xbfffffff) in the virtual machine, and notice I'm
>assigning 3/4 of the ram to cma region and 1/8 to a device driver (just for
>test).
>
>When I boot the machine, I see this message during the boot.
>
> Memory: 1020140K/1048576K available (3200K kernel code, 386K rwdata,
>808K rodata, 7808K init, 106K bss, 28436K reserved, 0K cma-reserved)
>
>Why is the CMA-reserved area is 0KB?
>This is some config variables I added for CMA test.
>
> CONFIG_MEMORY_ISOLATION=y
> CONFIG_CONTIG_ALLOC=y
> ONFIG_CMA=y
> CONFIG_CMA_DEBUG=y
> CONFIG_CMA_DEBUGFS=y
> CONFIG_CMA_SYSFS=y
> CONFIG_CMA_AREAS=7
> # CONFIG_DMA_CMA is not set
>
>I tried adding 'cma=768MB' in the boot args or changed CONFIG_CMA_AREAS to
1
>but it is the same.
>What am I missing??
>
>Thank you.
>
>Chan Kim
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
next reply other threads:[~2023-01-03 8:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-03 8:48 Chan Kim [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-01-03 5:35 How can I reserve contiguous mem alloc region? Chan Kim
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='004901d91f50$1f9d2f60$5ed78e20$@etri.re.kr' \
--to=ckim@etri.re.kr \
--cc=kernelnewbies@kernelnewbies.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).