Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAM available #5

Open
pkkrusty opened this issue Oct 19, 2024 · 9 comments
Open

RAM available #5

pkkrusty opened this issue Oct 19, 2024 · 9 comments

Comments

@pkkrusty
Copy link

I used a debian image from wvthoog.nl to flash a stick (with kernel 5.5) and available RAM shows as 381MB. I just built an image with your script and htop shows only 317MB available. Where did the RAM go? Are there options I can enable or disable to reclaim some of it? I'm not familiar with building linux kernels (this was my first time (and that was just using your script).

@kinsamanka
Copy link
Owner

free will show you the exact memory usage.

@pkkrusty
Copy link
Author

pkkrusty commented Oct 21, 2024

total used free shared buff/cache available
Mem: 325040 233356 7256 1236 95048 91684

The module has 512MB RAM, and with the other linux image, I get the following:

total used free shared buff/cache available
Mem: 390480 277328 4516 1228 120040 113152

The programs I'm using seem to use comparatively less using your script, they all run together using 233MB, but use 277MB on the other build. Maybe RAM is being counted differently?

I read somewhere that the modem uses 80MB of available RAM. But that still leaves a lot unaccounted for.

@kinsamanka
Copy link
Owner

I think the difference is due to the device tree used by the 6.6 kernel.

The total is the actual memory available to linux less the reserved memory.

This is the reserved memory for the 6.6 kernel:

        reserved-memory {
                #address-cells = <0x02>;
                #size-cells = <0x02>;
                ranges;

                tz-apps@86000000 {
                        reg = <0x00 0x86000000 0x00 0x300000>;
                        no-map;
                };

                smem@86300000 {
                        compatible = "qcom,smem";
                        reg = <0x00 0x86300000 0x00 0x100000>;
                        no-map;
                        hwlocks = <0x02 0x03>;
                        qcom,rpm-msg-ram = <0x03>;
                };

                hypervisor@86400000 {
                        reg = <0x00 0x86400000 0x00 0x100000>;
                        no-map;
                };

                tz@86500000 {
                        reg = <0x00 0x86500000 0x00 0x180000>;
                        no-map;
                };

                reserved@86680000 {
                        reg = <0x00 0x86680000 0x00 0x80000>;
                        no-map;
                };

                rmtfs@86700000 {
                        compatible = "qcom,rmtfs-mem";
                        reg = <0x00 0x86700000 0x00 0xe0000>;
                        no-map;
                        qcom,client-id = <0x01>;
                };

                rfsa@867e0000 {
                        reg = <0x00 0x867e0000 0x00 0x20000>;
                        no-map;
                };

                mpss@86800000 {
                        reg = <0x00 0x86800000 0x00 0x5500000>;
                        no-map;
                        status = "okay";
                        phandle = <0x62>;
                };

                wcnss {
                        size = <0x00 0x600000>;
                        alignment = <0x00 0x100000>;
                        alloc-ranges = <0x00 0x86800000 0x00 0x8000000>;
                        no-map;
                        status = "okay";
                        phandle = <0x8d>;
                };

                venus {
                        size = <0x00 0x500000>;
                        alignment = <0x00 0x100000>;
                        alloc-ranges = <0x00 0x86800000 0x00 0x8000000>;
                        no-map;
                        status = "okay";
                        phandle = <0x55>;
                };

                mba {
                        size = <0x00 0x100000>;
                        alignment = <0x00 0x100000>;
                        alloc-ranges = <0x00 0x86800000 0x00 0x8000000>;
                        no-map;
                        status = "okay";
                        phandle = <0x61>;
                };

                gps {
                        size = <0x00 0x200000>;
                        alignment = <0x00 0x100000>;
                        alloc-ranges = <0x00 0x86800000 0x00 0x8000000>;
                        no-map;
                        status = "disabled";
                        phandle = <0x16>;
                };
        };

I can't find the equivalent usage on the 5.x kernel.

Disabling some of these entries would increase the available memory (for example the venus entry is for Hardware-accelerated video codecs).

@pkkrusty
Copy link
Author

Where is this file? Any idea how to disable the unneeded sections? Video codecs for example. And even GPS (without an antenna, the devices barely pick up any signals). Some discussion on the PostmarketOS boards indicated that the modem partition is way over-allocated and doesn't need all the memory it's given. But all that is way over my head at the moment.

@kinsamanka
Copy link
Owner

This is from the device tree file defined at /boot/extlinux/extlinux.conf.

To disable any memory region, just change status = "okay"; to status = "disabled";.

On changing the allocated size, you will need to study the corresponding drivers.

You will need the device-tree-compiler package to edit the dtb.

To convert dtb to dts:

dtc -I dtb -O dts <dtb file> -o <dts file>

Edit the resulting dts using any text editor.

To convert back to dtb:

dtc -I dts -O dtb <dts file> -o <dtb file>

@he1pu
Copy link

he1pu commented Nov 6, 2024

Excuse me, have you solved this problem.

@pkkrusty
Copy link
Author

pkkrusty commented Nov 6, 2024

No, I gave up and went back to an image that someone else created.

@he1pu
Copy link

he1pu commented Nov 6, 2024

Is it also an Alpine system? May I use it

@pkkrusty
Copy link
Author

pkkrusty commented Nov 6, 2024

No, debian system. i recommend using this image: https://download.wvthoog.nl/openstick-uz801-v3.0.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants