* [RFC] vmsplice() and ->steal()
@ 2016-12-10 2:38 Al Viro
2016-12-10 3:03 ` Al Viro
0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2016-12-10 2:38 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-fsdevel, Nicholas Piggin, Miklos Szeredi
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().
Comments?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC] vmsplice() and ->steal()
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
0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2016-12-10 3:03 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-fsdevel, Nicholas Piggin, Miklos Szeredi
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?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC] vmsplice() and ->steal()
2016-12-10 3:03 ` Al Viro
@ 2016-12-10 5:28 ` Nicholas Piggin
0 siblings, 0 replies; 3+ messages in thread
From: Nicholas Piggin @ 2016-12-10 5:28 UTC (permalink / raw)
To: Al Viro; +Cc: Jens Axboe, linux-fsdevel, Miklos Szeredi
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-10 5:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).