mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: "hch@lst.de" <hch@lst.de>,
	Julian Stecklina <julian.stecklina@cyberus-technology.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] initrd: support erofs as initrd
Date: Tue, 8 Apr 2025 00:05:39 +0800	[thread overview]
Message-ID: <d7866b45-099f-40de-b192-45b647a90458@linux.alibaba.com> (raw)
In-Reply-To: <20250407085751.GA27074@lst.de>

Hi Christoph,

On 2025/4/7 16:57, hch@lst.de wrote:
> On Fri, Mar 21, 2025 at 01:17:54PM +0000, Julian Stecklina wrote:
>> Of course there are some solutions to using erofs images at boot now:
>> https://github.com/containers/initoverlayfs
>>
>> But this adds yet another step in the already complex boot process and feels
>> like a hack. It would be nice to just use erofs images as initrd. The other
>> building block to this is automatically sizing /dev/ram0:
>>
>> https://lkml.org/lkml/2025/3/20/1296
>>
>> I didn't pack both patches into one series, because I thought enabling erofs
>> itself would be less controversial and is already useful on its own. The
>> autosizing of /dev/ram is probably more involved than my RFC patch. I'm hoping
>> for some input on how to do it right. :)
> 
> Booting from erofs seems perfectly fine to me.  Booting from erofs on
> an initrd is not.  There is no reason to fake up a block device, just
> have a version of erofs that directly points to pre-loaded kernel
> memory instead.  This is a bit more work, but a lot more efficient
> in that it removes the block path from the I/O stack, removes the boot
> time copy and allows for much more flexible memory management.

For unencoded (uncompressed) images, especially data is page-aligned,
FSDAX can be used directly to replace page cache, which is absolutely
fine now.

But for encoded I/Os, since it needs for somewhat data transformation,
currently BIOs (actually mainly bio_vecs, but bio_vecs are lack of
useful interfaces) is needed to get the on-disk (or original memory)
encoded data in a flexible way.

I hope BIO (or some other-like interfaces) can be eventually decoupled
from block devices, and instead form generic block-based interfaces
anyway, so that eveutually yes, we don't need to fake a block device
(like FSDAX support for brd) like the old initrd.  But I suspect if
any folk puts more development resource to work on this (I don't
have more resource from my current employer), so personally I guess
initrd could be workable for the first step for people to leverage
this feature in some way.

Thanks,
Gao Xiang

  parent reply	other threads:[~2025-04-07 16:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-20 19:28 Julian Stecklina via B4 Relay
2025-03-21  2:08 ` Al Viro
2025-03-21  8:46   ` Christian Brauner
2025-03-21 12:49   ` Julian Stecklina
2025-03-21  5:01 ` Christoph Hellwig
2025-03-21  5:27   ` Gao Xiang
2025-03-21 13:17     ` Julian Stecklina
2025-03-21 13:57       ` Gao Xiang
2025-04-07  8:57       ` hch
2025-04-07 11:19         ` Julian Stecklina
2025-04-07 16:05         ` Gao Xiang [this message]
2025-08-25 18:27   ` Askar Safin
2025-08-26  7:59     ` Christoph Hellwig
2025-08-26 14:21       ` Byron Stanoszek
2025-08-26 15:32         ` Gao Xiang
2025-08-26 16:00           ` Gao Xiang
2025-08-27  9:22           ` Askar Safin
2025-08-27  9:48             ` Gao Xiang
2025-08-27  9:58               ` Gao Xiang
2025-08-28 16:44                 ` Askar Safin
2025-08-28 17:00                   ` Gao Xiang
2025-08-28 17:14                     ` Gao Xiang
2025-08-30 11:49                       ` Askar Safin
2025-08-30 12:23                         ` Gao Xiang
2025-08-26 17:00         ` Askar Safin
2025-03-21  8:48 ` Christian Brauner
2025-03-21  9:16 ` Thomas Weißschuh
2025-03-21 13:26   ` Julian Stecklina

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=d7866b45-099f-40de-b192-45b647a90458@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=julian.stecklina@cyberus-technology.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®