From: Nicholas Piggin <npiggin@gmail.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-fsdevel@vger.kernel.org,
Miklos Szeredi <mszeredi@redhat.com>
Subject: Re: [RFC] vmsplice() and ->steal()
Date: Sat, 10 Dec 2016 15:28:18 +1000 [thread overview]
Message-ID: <20161210152818.0c60ac01@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <20161210030354.GI1555@ZenIV.linux.org.uk>
On Sat, 10 Dec 2016 03:03:54 +0000
Al Viro <viro@ZenIV.linux.org.uk> wrote:
> On Sat, Dec 10, 2016 at 02:38:49AM +0000, Al Viro wrote:
> > vmsplice() generates pipe_bufs with ->steal() set to
> > user_page_pipe_buf_steal(). What should happen when the source pages
> > had code from an mmapped area and why shouldn't their ->steal()
> > do what page_cache_pipe_buf_release() does in that case?
> >
> > As it is, e.g. fuse_dev_splice_write() getting fed that stuff could,
> > AFAICS, clear MappedToDisk on such a page, scream about weird pages
> > (upon noticing non-NULL ->mapping) and fall back to copying (thankfully).
> > We don't have that many ->steal() users (as the matter of fact, I've
> > discovered that while trying to debug the breakage in one I'd been
> > trying to add), but I really wonder about the intended semantics of
> > ->steal().
>
> Hmm... Nope, the source of breakage is different, and these
> guys will simply fail ->steal() - pages present in page cache will
> have refcount >= 2 due to the buf->page contributing to it. My apologies...
>
> BTW, why doesn't page_cache_pipe_buf_steal() clear MappedToDisk
> on its own in case of success?
It probably should by the looks.
Off topic, but I would like to see MappedToDisk returned to an "owner
private" bit, and have filesystem ops do all the tests. Outside of the
buffer_head based mappings, it's never been used enough to justify
taking a pagecache-wide bit IMO.
prev parent reply other threads:[~2016-12-10 5:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-10 2:38 [RFC] vmsplice() and ->steal() Al Viro
2016-12-10 3:03 ` Al Viro
2016-12-10 5:28 ` Nicholas Piggin [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=20161210152818.0c60ac01@roar.ozlabs.ibm.com \
--to=npiggin@gmail.com \
--cc=axboe@kernel.dk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mszeredi@redhat.com \
--cc=viro@ZenIV.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).