All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/2] RFC: erofs: memory-backed mount for non-page-aligned ranges
@ 2026-06-18 16:13 ` Alberto Ruiz via B4 Relay
  0 siblings, 0 replies; 8+ messages in thread
From: Alberto Ruiz @ 2026-06-18 16:13 UTC (permalink / raw)
  To: Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu, Sandeep Dhavale, Hongbo Li,
	Chunhai Guo
  Cc: linux-kernel, linux-erofs, Javier Martinez Canillas, Brian Masney,
	Eric Curtin, Alberto Ruiz

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>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-06-22 18:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-18 16:13 [PATCH RFC 0/2] RFC: erofs: memory-backed mount for non-page-aligned ranges Alberto Ruiz
2026-06-18 16:13 ` Alberto Ruiz via B4 Relay
2026-06-18 16:13 ` [PATCH RFC 1/2] erofs: add memory-backed mode for non-page-aligned mount Alberto Ruiz
2026-06-18 16:13   ` 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
2026-06-18 16:13   ` Alberto Ruiz via B4 Relay
2026-06-22 18:52   ` kernel test robot
2026-06-19  0:32 ` [PATCH RFC 0/2] RFC: erofs: memory-backed mount for non-page-aligned ranges Gao Xiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.