mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julian Stecklina <julian.stecklina@cyberus-technology.de>
To: "hch@lst.de" <hch@lst.de>
Cc: "torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH RFC] initrd: resize /dev/ram as needed
Date: Sat, 22 Mar 2025 18:23:39 +0000	[thread overview]
Message-ID: <4b6434f738cdf10b6622b3d4f0987e29b0175da4.camel@cyberus-technology.de> (raw)
In-Reply-To: <20250321050146.GD1831@lst.de>

Hi Christoph,

On Fri, 2025-03-21 at 06:01 +0100, Christoph Hellwig wrote:
> On Thu, Mar 20, 2025 at 08:46:14PM +0100, Julian Stecklina via B4 Relay wrote:
> > From: Julian Stecklina <julian.stecklina@cyberus-technology.de>
> > 
> > When the initrd doesn't fit into the RAM disk, we currently just die.
> > This is unfortunate, because users have to manually configure the RAM
> > disk size for no good reason. It also means that the kernel command
> > line needs to be changed for different initrds, which is sometimes
> > cumbersome.
> > 
> > Attempt resizing /dev/ram to fit the RAM disk size instead. This makes
> > initrd images work a bit more like initramfs images in that they just
> > work.
> > 
> > Of course, this only works, because we know that /dev/ram is a RAM
> > disk and we can resize it freely. I'm not sure whether I've used the
> > blockdev APIs here in a sane way. If not, please advise!
> 
> Just use an initramfs and avoid all these problems.
> 

Well, as Gao Xiang put it in the other mail: CPIO is somewhat inflexible. So
here we are. :)

That being said, I saw that the RAM disk code allocates memory on demand, so
there is no downsize to set the default size to 1G and not bother with resizing
it. Problem solved! Patch not needed.

Julian

      reply	other threads:[~2025-03-22 18:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-20 19:46 Julian Stecklina via B4 Relay
2025-03-21  5:01 ` Christoph Hellwig
2025-03-22 18:23   ` Julian Stecklina [this message]

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=4b6434f738cdf10b6622b3d4f0987e29b0175da4.camel@cyberus-technology.de \
    --to=julian.stecklina@cyberus-technology.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®