All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Zhan Xusheng <zhanxusheng1024@gmail.com>, Gao Xiang <xiang@kernel.org>
Cc: chao@kernel.org, Jingbo Xu <jefflexu@linux.alibaba.com>,
	zhanxusheng@xiaomi.com, linux-erofs@lists.ozlabs.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] erofs: support splice() in inode_share mode
Date: Mon, 24 Aug 2026 08:46:39 +0800	[thread overview]
Message-ID: <db054464-072a-4246-810f-07385606725e@kernel.org> (raw)
In-Reply-To: <20260821015641.1936276-1-zhanxusheng@xiaomi.com>

On 8/21/26 09:56, Zhan Xusheng wrote:
> From: Zhan Xusheng <zhanxusheng1024@gmail.com>
> 
> From: Zhan Xusheng <zhanxusheng@xiaomi.com>
> 
> erofs_ishare_fops routes everything that touches the page cache to the
> backing file in ->private_data: read_iter clones the iocb onto it, mmap
> does vma_set_file(), fadvise calls vfs_fadvise() on it.  splice_read was
> left as filemap_splice_read(), which works on the user file's own mapping:
> it does init_sync_kiocb(&iocb, in), and filemap_get_pages() then takes
> iocb->ki_filp->f_mapping.
> 
> So splice() and sendfile() fill the per-inode page cache rather than the
> shared one.  The content is the same either way, since erofs_fill_inode()
> sets a_ops on that mapping too, which is why this went unnoticed.  Two
> identical 8 MiB files under inode_share, reading one of them with splice(2)
> alone, in pages:
> 
>    before   own 2048   shared 0
>    after    own 0      shared 2048
> 
> "own" is cachestat(fd), which reports the file's own mapping; "shared" is
> mmap()+mincore(), which erofs_ishare_mmap() redirects to the backing file.
> 
> Read through the backing file, as read_iter already does.
> 
> Link: https://lore.kernel.org/all/b7dc7192-d586-45a2-bc4a-b41dc681c9bb@linux.alibaba.com/
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,


      parent reply	other threads:[~2026-08-24  0:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  1:56 [PATCH v2] erofs: support splice() in inode_share mode Zhan Xusheng
2026-08-21  6:33 ` Jingbo Xu
2026-08-24  0:46 ` Chao Yu [this message]

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=db054464-072a-4246-810f-07385606725e@kernel.org \
    --to=chao@kernel.org \
    --cc=jefflexu@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiang@kernel.org \
    --cc=zhanxusheng1024@gmail.com \
    --cc=zhanxusheng@xiaomi.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 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.