mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alberto Ruiz via B4 Relay <devnull+aruiz.redhat.com@kernel.org>
To: Gao Xiang <xiang@kernel.org>, Chao Yu <chao@kernel.org>,
	 Yue Hu <zbestahu@gmail.com>,
	Jeffle Xu <jefflexu@linux.alibaba.com>,
	 Sandeep Dhavale <dhavale@google.com>,
	Hongbo Li <lihongbo22@huawei.com>,
	 Chunhai Guo <guochunhai@vivo.com>
Cc: linux-kernel@vger.kernel.org, linux-erofs@lists.ozlabs.org,
	 Javier Martinez Canillas <javierm@redhat.com>,
	 Brian Masney <bmasney@redhat.com>,
	Eric Curtin <ericcurtin17@gmail.com>,
	 Alberto Ruiz <aruiz@redhat.com>
Subject: [PATCH RFC 0/2] RFC: erofs: memory-backed mount for non-page-aligned ranges
Date: Thu, 18 Jun 2026 17:13:43 +0100	[thread overview]
Message-ID: <20260618-erofs-memback-v1-0-5aa7006a241a@redhat.com> (raw)

This series adds a memory-backed ("memback") mode to EROFS that
allows mounting an EROFS image directly from a kernel memory region
without going through the block layer.

I am sending this as an RFC to get EROFS maintainer feedback on
this approach before building the full initramfs series on top of
it.  The memback mode may also be useful for other use cases beyond
initramfs where EROFS images need to be served directly from
memory, though it may need further hardening for more general use
cases.

Previous review feedback on the initramfs patches raised concerns
about the block layer dependency — this series addresses that by
providing a direct memory-backed path.  It also adds support for
non-page-aligned memory ranges, which is the common case for
initramfs images packed at arbitrary cpio boundaries.  Supporting
non-page-aligned ranges is essential for true zero-copy access —
requiring page alignment would force a copy into an aligned buffer
before the data can be used, defeating the purpose.

The full initramfs integration (init/ changes) that wires up the
EROFS initrd detection and layered mount is available for reference
here[0]. It implements support for interleaved cpio and EROFS
layers, it supports cpio CPU microcode update prefix, and uses
overlayfs+tmpfs for write support.

This series was developed with the assistance of Claude Opus 4.6.
All patches carry an Assisted-by tag. I am providing the kunit
testing and I have tested this change against the initramfs series
to boot an EROFS initramfs. I welcome feedback on the approach and
implementation.

Patch 1 adds the core memback implementation.
Patch 2 adds a KUnit test that mounts a compressed EROFS image at a
non-page-aligned offset and verifies decompressed file contents.

[0] https://github.com/aruiz/linux/tree/wip/erofs-initramfs-memback

Signed-off-by: Alberto Ruiz <aruiz@redhat.com>
---
Alberto Ruiz (2):
      erofs: add memory-backed mode for non-page-aligned mount
      erofs: add KUnit test for memory-backed compressed mount

 fs/erofs/Kconfig        |  11 ++++
 fs/erofs/Makefile       |   2 +
 fs/erofs/data.c         |  33 +++++++++-
 fs/erofs/internal.h     |  53 +++++++++++----
 fs/erofs/memback.c      | 169 ++++++++++++++++++++++++++++++++++++++++++++++++
 fs/erofs/memback_test.c | 151 ++++++++++++++++++++++++++++++++++++++++++
 fs/erofs/super.c        |  38 +++++++++--
 fs/erofs/zdata.c        |  16 +++--
 8 files changed, 447 insertions(+), 26 deletions(-)
---
base-commit: 6b5a2b7d9bc156e505f09e698d85d6a1547c1206
change-id: 20260617-erofs-memback-0ae2448ba2cc

Best regards,
--  
Alberto Ruiz <aruiz@redhat.com>



             reply	other threads:[~2026-06-18 16:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18 16:13 Alberto Ruiz via B4 Relay [this message]
2026-06-18 16:13 ` [PATCH RFC 1/2] erofs: add memory-backed mode for non-page-aligned mount Alberto Ruiz via B4 Relay
2026-06-18 16:13 ` [PATCH RFC 2/2] erofs: add KUnit test for memory-backed compressed mount Alberto Ruiz via B4 Relay
2026-06-19  0:32 ` [PATCH RFC 0/2] RFC: erofs: memory-backed mount for non-page-aligned ranges Gao Xiang

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=20260618-erofs-memback-v1-0-5aa7006a241a@redhat.com \
    --to=devnull+aruiz.redhat.com@kernel.org \
    --cc=aruiz@redhat.com \
    --cc=bmasney@redhat.com \
    --cc=chao@kernel.org \
    --cc=dhavale@google.com \
    --cc=ericcurtin17@gmail.com \
    --cc=guochunhai@vivo.com \
    --cc=javierm@redhat.com \
    --cc=jefflexu@linux.alibaba.com \
    --cc=lihongbo22@huawei.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiang@kernel.org \
    --cc=zbestahu@gmail.com \
    /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®