This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM62A7: AM62A7-memory issue

Part Number: AM62A7

Tool/software:

Hi teams:

sdk version:sdk 806

We have configured the memory from 4G to 2GB, but when there is no running memory after booting up, it shows that only 1.3GB is available, which is close to 700MB and missing. May I ask where this part is occupied

linux-kernel/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
index 8b8496f10..df824af48 100644
--- a/ti-processor-sdk-linux-am62axx-evm-08.06.00.45/board-support/linux-kernel/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
+++ b/ti-processor-sdk-linux-am62axx-evm-08.06.00.45/board-support/linux-kernel/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts
@@ -31,8 +31,8 @@ chosen {
        memory@80000000 {
                device_type = "memory";
                /* 4G RAM */
-               reg = <0x00000000 0x80000000 0x00000000 0x80000000>,
-                     <0x00000008 0x80000000 0x00000000 0x80000000>;
+               reg = <0x00000000 0x80000000 0x00000000 0x40000000>,
+                     <0x00000008 0x80000000 0x00000000 0x40000000>;
        };

        dma_buf_phys {

1:How to optimize and obtain as much available memory as possible

2:If optimization is not possible, is there any way to clearly know where this memory is being used

thx

  • Hi Wu,

    Also check the reserved-memory section in the DTS file:

    reserved-memory {
    		#address-cells = <2>;
    		#size-cells = <2>;
    		ranges;
    
    		/* global cma region */
    		linux,cma {
    			compatible = "shared-dma-pool";
    			reusable;
    			size = <0x00 0x24000000>;
    			alloc-ranges = <0x00 0xc0000000 0x00 0x24000000>;
    			linux,cma-default;
    		};
    
    		secure_tfa_ddr: tfa@9e780000 {
    			reg = <0x00 0x9e780000 0x00 0x80000>;
    			alignment = <0x1000>;
    			no-map;
    		};
    
    		secure_ddr: optee@9e800000 {
    			reg = <0x00 0x9e800000 0x00 0x01800000>; /* for OP-TEE */
    			alignment = <0x1000>;
    			no-map;
    		};
    
    		wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@9c800000 {
    			compatible = "shared-dma-pool";
    			reg = <0x00 0x9c800000 0x00 0x100000>;
    			no-map;
    		};
    
    		wkup_r5fss0_core0_memory_region: r5f-dma-memory@9c900000 {
    			compatible = "shared-dma-pool";
    			reg = <0x00 0x9c900000 0x00 0x01e00000>;
    			no-map;
    		};
    
    		mcu_r5fss0_core0_dma_memory_region: r5f-dma-memory@9b800000 {
    			compatible = "shared-dma-pool";
    			reg = <0x00 0x9b800000 0x00 0x100000>;
    			no-map;
    		};
    
    		mcu_r5fss0_core0_memory_region: r5f-dma-memory@9b900000 {
    			compatible = "shared-dma-pool";
    			reg = <0x00 0x9b900000 0x00 0x0f00000>;
    			no-map;
    		};
    
    		c7x_0_dma_memory_region: c7x-dma-memory@99800000 {
    			compatible = "shared-dma-pool";
    			reg = <0x00 0x99800000 0x00 0x100000>;
    			no-map;
    		};
    
    		c7x_0_memory_region: c7x-memory@99900000 {
    			compatible = "shared-dma-pool";
    			reg = <0x00 0x99900000 0x00 0x01efffff>;
    			no-map;
    		};
    
    		edgeai_rtos_ipc_memory_region: edgeai-rtos-ipc-memory-region {
    			reg = <0x00 0xa0000000 0x00 0x01000000>;
    			no-map;
    		};
    
    		edgeai_memory_region: edgeai-dma-memory@a1000000 {
    			compatible = "shared-dma-pool";
    			reg = <0x00 0xa1000000 0x00 0x02000000>;
    			no-map;
    		};
    
    		edgeai_shared_region: edgeai_shared-memories {
    			compatible = "dma-heap-carveout";
    			reg = <0x00 0xa3000000 0x00 0x0b000000>;
    		};
    
    		edgeai_core_heaps: edgeai-core-heap-memory@ae000000 {
    			compatible = "shared-dma-pool";
    			reg = <0x00 0xae000000 0x00 0x12000000>;
    			no-map;
    		};
    	};
    

    EdgeAI node is almost 300MB.. 

    Best Regards,

    Suren

  • hi suren:

    I see,but 2.0G -300M = 1.7G, now is 1.3G on total,where is the 400M?

  • Hi Wu, 

    Its edgeAI taking 300MB, but if you look at the reserved-memory, we are also reserving memory for the other cores.

    Have you modified the reserved memory and see any changes?

    Best Regards,

    Suren

  • May I ask which specific cores use 400M,

    Like the patch above, I did not modify the reserved memory section of DTS

  • Please add the details in the reserved memory and see if its more than 600MB in total, that should answer why you are seeing 1.3G of Free memory.

    Best Regards,

    Suren

  • My reserver memory debugging and printing information shows a total of 398M, which is approximately equivalent to 400M. 2G-400M=1.6G, and now it is 1.3G. Where did the other 300M go

    below:

    288M+32M+30M+1M+15M+1M+30M+1M=398M

    [    0.000000] efi: UEFI not found.
    [    0.000000] 1reserved mem  size:1 name:c7x-dma-memory@99800000
    [    0.000000] Reserved memory: created DMA memory pool at 0x0000000099800000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node c7x-dma-memory@99800000, compatible id shared-dma-pool
    [    0.000000] 1reserved mem  size:30 name:c7x-memory@99900000
    [    0.000000] Reserved memory: created DMA memory pool at 0x0000000099900000, size 30 MiB
    [    0.000000] OF: reserved mem: initialized node c7x-memory@99900000, compatible id shared-dma-pool
    [    0.000000] 1reserved mem  size:1 name:r5f-dma-memory@9b800000
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009b800000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9b800000, compatible id shared-dma-pool
    [    0.000000] 1reserved mem  size:15 name:r5f-dma-memory@9b900000
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009b900000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9b900000, compatible id shared-dma-pool
    [    0.000000] 1reserved mem  size:1 name:r5f-dma-memory@9c800000
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009c800000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9c800000, compatible id shared-dma-pool
    [    0.000000] 1reserved mem  size:30 name:r5f-dma-memory@9c900000
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009c900000, size 30 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9c900000, compatible id shared-dma-pool
    [    0.000000] 1reserved mem  size:32 name:edgeai-dma-memory@a1000000
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1000000, size 32 MiB
    [    0.000000] OF: reserved mem: initialized node edgeai-dma-memory@a1000000, compatible id shared-dma-pool
    [    0.000000] OF: reserved mem: initialized node edgeai_shared-memories, compatible id dma-heap-carveout
    [    0.000000] 1reserved mem  size:288 name:edgeai-core-heap-memory@ae000000
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000ae000000, size 288 MiB
    [    0.000000] OF: reserved mem: initialized node edgeai-core-heap-memory@ae000000, compatible id shared-dma-pool

  • Hi Wu,

    So based on your reserved memory of ~400 MB, used memory of 156MB and buff/cache of ~101MB, it totals to ~650MB so the total available shows up as 1.3GB.

    Best Regards,

    Suren

  • hi Suren :

    Total=2G - resident memory - others, total already includes used, cached/buffer. Is there a problem with the calculation above? The problem is where others are used

  • Hi Wu,

    Please refer the below link:

    https://www.linuxatemyram.com/

    and the commit ID that was referenced in the above link for understanding the Total memory, Free memory and Available memory.

    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773

    Hope this helps.

    Best Regards,

    Suren

  • My reserver memory debugging and printing information shows a total of 398M, which is approximately equivalent to 400M. 2G-400M=1.6G, and now it is 1.3G. Where did the other 300M go

    so 300M is kernel code,data ?

  • Hi Wu,

    Can you see the output of the command:

    dmesg | grep Memory 

    Best Regards,

    Suren

  • hi Suren:

    it got noting

    m62axx-evm login: root
    d^[[59;157RCSI Camera 0 detected
        device = /dev/video2
        name = imx219
        format = [fmt:UYVY8_1X16/1920x1280]
        subdev_id = /dev/v4l-subdev2
        isp_required = yes
    meroot@am62axx-evm:~# 9;157Rme^C
    root@am62axx-evm:~# dmesg|grep dmesg | grep Memory  
    
    root@am62axx-evm:~# 
    root@am62axx-evm:~# 

    this total 

    0042.dmesg.txt

  • Hi Wu,

    Line #114 in the attached dmesg.txt shows this:

    [    0.000000] Memory: 1137248K/2097148K available (11200K kernel code, 1162K rwdata, 4320K rodata, 1920K init, 431K bss, 755100K reserved, 204800K cma-reserved)

    Hope this helps.

    Best Regards,

    Suren

  • 2097148K-1920K-755100K=1340128K, with a difference of 3M, approaching 1343968K

    root@am62axx-evm:~# free -k    
                  total        used        free      shared  buff/cache   available
    Mem:        1343968      155936     1086348       10800      101684     1060284
    Swap:             0           0           0