~alpine/users

1

Re: Diskless Memory Split

Kevin Garman <Garman@scadaware.com>
Details
Message ID
<MW5PR22MB306029739F3BBF654899204CD6D29@MW5PR22MB3060.namprd22.prod.outlook.com>
DKIM signature
missing
Download raw message
Perfect, thanks Tom!  You definitely pointed me in the right direction.  And since I'm on a raspberry pi in this particular instance, all I needed to do was add root_size=300M to my cmdline.txt file.


________________________________
From: Thomas Reid <tom.d.reid@gmail.com>
Sent: Thursday, May 19, 2022 09:09
To: Kevin Garman <Garman@scadaware.com>
Subject: Re: Diskless Memory Split

>In a diskless system, 50% (i think?) of system ram is used for the root file system.....is there a way to configure that split? ....perhaps use 60% for the root file system? Or, if I have a lot of ram, maybe only use 10% for the root file system?

Have a look at the initramfs-init.
You can set the rootflags KOPT to set the rootfs size size=whatever%
You can also look at the size of the shm tmpfs.

Hope this starts to point you in the right direction.

Tom




On May 19, 2022 at 12:46:11, Kevin Garman (garman@scadaware.com<mailto:garman@scadaware.com>) wrote:

In a diskless system, 50% (i think?) of system ram is used for the root file system.....is there a way to configure that split?  ....perhaps use 60% for the root file system?  Or, if I have a lot of ram, maybe only use 10% for the root file system?

Re: Diskless Memory Split

Details
Message ID
<2b30d6b1-a70d-a995-6027-6e4724cf03f4@ipik.org>
In-Reply-To
<MW5PR22MB306029739F3BBF654899204CD6D29@MW5PR22MB3060.namprd22.prod.outlook.com> (view parent)
DKIM signature
missing
Download raw message
Sorry for resurrecting this discussion.

Following Thomas' hint and looking at initramfs-init we can see that:
- shm is using default tmps allocation so is 50% (line 339)
- then (line 607) rootfs is allocated with (potentially)
rootflags=size=XXX directive from cmdline
Should't allocation be in reverse order (shm to get half of remaining of
what is not allocated to rootfs)?

Let's say I'm on 512MB Pi.
Some RAM being reserved by GPU and used for kernel, let's assume 430MB
is avail when entering initramfs (real-life case).
By default shm then gets 215MB
Then rootfs is set with rootflags=size=400MB due to cmdline directive
(using big number to illustrate problem).
This situation may cause OOM situations when rootfs gets filled.

If allocation is reversed:
rootfs first gets 400MB, then shm would be half of then remaining: 15MB
Wouldn't it be safer?

Thanks for any thought.


On 21/05/2022 05:09, Kevin Garman wrote:
> Perfect, thanks Tom!  You definitely pointed me in
> the right direction.  And since I'm on a raspberry pi in this
> particular instance, all I needed to do was add root_size=300M to my
> cmdline.txt file.
>
>
> ------------------------------------------------------------------------
> *From:* Thomas Reid <tom.d.reid@gmail.com>
> *Sent:* Thursday, May 19, 2022 09:09
> *To:* Kevin Garman <Garman@scadaware.com>
> *Subject:* Re: Diskless Memory Split
>  
> >In a diskless system, 50% (i think?) of system ram is used for the
> root file system.....is there a way to configure that split?
> ....perhaps use 60% for the root file system? Or, if I have a lot of
> ram, maybe only use 10% for the root file system?
>
> Have a look at the initramfs-init.
> You can set the rootflags KOPT to set the rootfs size size=whatever%
> You can also look at the size of the shm tmpfs.
>
> Hope this starts to point you in the right direction.
>
> Tom
>
>
>
> On May 19, 2022 at 12:46:11, Kevin Garman (garman@scadaware.com) wrote:
>
>> In a diskless system, 50% (i think?) of system ram is used for the
>> root file system.....is there a way to configure that split?
>>  ....perhaps use 60% for the root file system?  Or, if I have a lot
>> of ram, maybe only use 10% for the root file system?
Reply to thread Export thread (mbox)