[PATCH v15 0/9] erofs: Introduce page cache sharing feature
Christoph Hellwig
hch at lst.de
Sat Jan 17 02:36:56 AEDT 2026
Sorry, just getting to this from my overful inbox by now.
On Fri, Jan 16, 2026 at 09:55:41AM +0000, Hongbo Li wrote:
> 2.1. file open & close
> ----------------------
> When the file is opened, the ->private_data field of file A or file B is
> set to point to an internal deduplicated file. When the actual read
> occurs, the page cache of this deduplicated file will be accessed.
So the first opener wins and others point to it? That would lead to
some really annoying life time rules. Or you allocate a hidden backing
file and have everyone point to it (the backing_file related subject
kinda hints at that), which would be much more sensible, but then the
above descriptions would not be correct.
>
> When the file is opened, if the corresponding erofs inode is newly
> created, then perform the following actions:
> 1. add the erofs inode to the backing list of the deduplicated inode;
> 2. increase the reference count of the deduplicated inode.
This on the other hand suggests the fist opener is used approach again?
> Assuming the deduplication inode's page cache is PGCache_dedup, there
What is PGCache_dedup?
> Iomap and the layers below will involve disk I/O operations. As
> described in 2.1, the deduplicated inode itself is not bound to a
> specific device. The deduplicated inode will select an erofs inode from
> the backing list (by default, the first one) to complete the
> corresponding iomap operation.
What happens for mmap I/O where folio->mapping is kinda important?
Also do you have a git tree for the whole feature?
More information about the Linux-erofs
mailing list