linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [LSF/MM TOPIC] reverse splice
@ 2019-02-21 12:56 Miklos Szeredi
  2019-02-21 14:28 ` Matthew Wilcox
  2019-02-21 14:29 ` Matthew Wilcox
  0 siblings, 2 replies; 3+ messages in thread
From: Miklos Szeredi @ 2019-02-21 12:56 UTC (permalink / raw)
  To: lsf-pc; +Cc: linux-fsdevel

rsplice would serve a similar purpose as splice, but in the other
direction.  I.e. instead of operating on buffers filled with data, it
would operate on empty buffers to be filled with data.  rsplice is to
splice as read is to write.

data source -> splice -> data destination
data destination -> rsplice -> data source

One use case would be zero-copy read in fuse.   Zero-copy writes work
with plain splice: page cache pages or userspace buffers are passed
through to the userspace filesystem server as pipe buffers and they
can be directed wherever the filesystem wants.   The reverse doesn't
work.  There's code to attempt stealing pages and inserting into the
fuse page cache, but this is far from being as generic as the write
path.

What do people think?  Is this crazy?  Are there major roadblocks for
implementation?  Would this have any other use cases?

To me it looks like this is pretty symmetrical with normal splice, the
big difference being that uninitialized buffers would be passed
around.  Obviously must make sure those buffers are write only, i.e.
the previous contents are inaccessible.

Thanks,
Miklos

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [LSF/MM TOPIC] reverse splice
  2019-02-21 12:56 [LSF/MM TOPIC] reverse splice Miklos Szeredi
@ 2019-02-21 14:28 ` Matthew Wilcox
  2019-02-21 14:29 ` Matthew Wilcox
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2019-02-21 14:28 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: lsf-pc, linux-fsdevel

On Thu, Feb 21, 2019 at 01:56:11PM +0100, Miklos Szeredi wrote:
> rsplice would serve a similar purpose as splice, but in the other
> direction.  I.e. instead of operating on buffers filled with data, it
> would operate on empty buffers to be filled with data.  rsplice is to
> splice as read is to write.
> 
> data source -> splice -> data destination
> data destination -> rsplice -> data source
> 
> One use case would be zero-copy read in fuse.   Zero-copy writes work
> with plain splice: page cache pages or userspace buffers are passed
> through to the userspace filesystem server as pipe buffers and they
> can be directed wherever the filesystem wants.   The reverse doesn't
> work.  There's code to attempt stealing pages and inserting into the
> fuse page cache, but this is far from being as generic as the write
> path.
> 
> What do people think?  Is this crazy?  Are there major roadblocks for
> implementation?  Would this have any other use cases?

This was something I was interested in last year for a project at my
then-employer.  It's not something I'm interested in right now, but I
could imagine it becoming interesting to me again fairly rapidly.

It's one of those projects I have to think very hard about and I don't
have the spare cycles to do that today.  So I think it should be done,
but I should probably stay focused on my other projects right now.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [LSF/MM TOPIC] reverse splice
  2019-02-21 12:56 [LSF/MM TOPIC] reverse splice Miklos Szeredi
  2019-02-21 14:28 ` Matthew Wilcox
@ 2019-02-21 14:29 ` Matthew Wilcox
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2019-02-21 14:29 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: lsf-pc, linux-fsdevel, linux-mm


... also, this really needs to be cc'd to linux-mm.

On Thu, Feb 21, 2019 at 01:56:11PM +0100, Miklos Szeredi wrote:
> rsplice would serve a similar purpose as splice, but in the other
> direction.  I.e. instead of operating on buffers filled with data, it
> would operate on empty buffers to be filled with data.  rsplice is to
> splice as read is to write.
> 
> data source -> splice -> data destination
> data destination -> rsplice -> data source
> 
> One use case would be zero-copy read in fuse.   Zero-copy writes work
> with plain splice: page cache pages or userspace buffers are passed
> through to the userspace filesystem server as pipe buffers and they
> can be directed wherever the filesystem wants.   The reverse doesn't
> work.  There's code to attempt stealing pages and inserting into the
> fuse page cache, but this is far from being as generic as the write
> path.
> 
> What do people think?  Is this crazy?  Are there major roadblocks for
> implementation?  Would this have any other use cases?
> 
> To me it looks like this is pretty symmetrical with normal splice, the
> big difference being that uninitialized buffers would be passed
> around.  Obviously must make sure those buffers are write only, i.e.
> the previous contents are inaccessible.
> 
> Thanks,
> Miklos

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-21 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-21 12:56 [LSF/MM TOPIC] reverse splice Miklos Szeredi
2019-02-21 14:28 ` Matthew Wilcox
2019-02-21 14:29 ` Matthew Wilcox

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).