]> git.ipfire.org Git - thirdparty/linux.git/commit
erofs: introduce the page cache share feature
authorHongzhen Luo <hongzhen@linux.alibaba.com>
Fri, 23 Jan 2026 01:31:28 +0000 (01:31 +0000)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Fri, 23 Jan 2026 12:02:09 +0000 (20:02 +0800)
commit5ef3208e3be50aa08b4e7a2832f34e16d42c08b3
treea73a33b72499c98e48b87fe69d2c7096f4bdb237
parente77762e8966c9466a84b22680ad04880dab11914
erofs: introduce the page cache share feature

Currently, reading files with different paths (or names) but the same
content will consume multiple copies of the page cache, even if the
content of these page caches is the same. For example, reading
identical files (e.g., *.so files) from two different minor versions of
container images will cost multiple copies of the same page cache,
since different containers have different mount points. Therefore,
sharing the page cache for files with the same content can save memory.

This introduces the page cache share feature in erofs. It allocate a
shared inode and use its page cache as shared. Reads for files
with identical content will ultimately be routed to the page cache of
the shared inode. In this way, a single page cache satisfies
multiple read requests for different files with the same contents.

We introduce new mount option `inode_share` to enable the page
sharing mode during mounting. This option is used in conjunction
with `domain_id` to share the page cache within the same trusted
domain.

Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Documentation/filesystems/erofs.rst
fs/erofs/Makefile
fs/erofs/internal.h
fs/erofs/ishare.c [new file with mode: 0644]
fs/erofs/super.c
fs/erofs/xattr.c
fs/erofs/xattr.h