Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id 2040A2231C1 for <~alpine/users@lists.alpinelinux.org>; Fri, 24 Feb 2023 08:34:51 +0000 (UTC) Received: (Authenticated sender: sendmail@ipik.org) by mail.gandi.net (Postfix) with ESMTPSA id DC50DC0004; Fri, 24 Feb 2023 08:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipik.org; s=gm1; t=1677227691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QWp2jgaTlsYTmR+mUad9qSWeMzTAnFVx9L/l4SKARfQ=; b=Y5dshqtqt+BBpg9MetIHzIU9sD0lQT1zURLCL2NJSp+sOK/O3Oj+4RoPmlahefASyrB0wT gR9VB+OflBp8Uemcn5cee6T9hGw9Q4YlA93lyC4ATFzcOQtc4+RSHnA544z3tNXflpldVB 5hWBvPwSy5mILgRhfaFSmWOulylQKpf94LVt60ncDTHCsPV4KugfNDx2XXwuTCsI+jWlrq 9YIWGgMapQSFZQNDpaDReuARKaPWIvkEhql0925rOTAsY7HerD2kKtqyctwslR9V1ufoWg KTRMzoHp5ep0wA2vBGSQbYwHF8fUgN5bv7s2KIxSEwUAho16mZOMabnxaVRWJA== Message-ID: <2b30d6b1-a70d-a995-6027-6e4724cf03f4@ipik.org> Date: Fri, 24 Feb 2023 09:34:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: Diskless Memory Split Content-Language: fr, en-US, en-GB To: Kevin Garman , Thomas Reid Cc: "~alpine/users@lists.alpinelinux.org" <~alpine/users@lists.alpinelinux.org> References: From: macmpi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 > *Sent:* Thursday, May 19, 2022 09:09 > *To:* Kevin Garman > *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?