Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-11-09 Thread Darrick J. Wong
On Tue, Oct 13, 2015 at 12:27:37AM -0700, Christoph Hellwig wrote: > On Mon, Oct 12, 2015 at 04:17:49PM -0700, Darrick J. Wong wrote: > > Hm. Peng's patches only generalize the CLONE and CLONE_RANGE ioctls from > > btrfs, however they don't port over the (vastly different) EXTENT_SAME > > ioctl.

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-16 Thread Austin S Hemmelgarn
On 2015-10-16 01:38, Christoph Hellwig wrote: On Thu, Oct 15, 2015 at 08:24:51AM -0400, Austin S Hemmelgarn wrote: My only point with saying we shouldn't reflink by default is that there are many (unintelligent) people who will assume that since the syscall has copy in it's name, that's what it

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-16 Thread Christoph Hellwig
On Fri, Oct 16, 2015 at 07:46:41AM -0400, Austin S Hemmelgarn wrote: > I should have been specific, what I meant was that some people will assume > that it actually creates a physical, on-disk byte-for-byte copy of the data. > There are many people out there (and sadly I have to deal with some at

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-16 Thread Pádraig Brady
On 16/10/15 12:46, Austin S Hemmelgarn wrote: > On 2015-10-16 01:38, Christoph Hellwig wrote: >> On Thu, Oct 15, 2015 at 08:24:51AM -0400, Austin S Hemmelgarn wrote: >>> My only point with saying we shouldn't reflink by default is that there are >>> many (unintelligent) people who will assume that

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-16 Thread Christoph Hellwig
On Fri, Oct 16, 2015 at 01:02:23PM +0100, P??draig Brady wrote: > Right. reflinking is transparent to the user, though its consequences are not. > Consequences being the possible extra latency or ENOSPC on CoW. You can get all these consequences without doing the file system reflink by using a

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-16 Thread Austin S Hemmelgarn
On 2015-10-16 08:24, Christoph Hellwig wrote: On Fri, Oct 16, 2015 at 01:02:23PM +0100, P??draig Brady wrote: Right. reflinking is transparent to the user, though its consequences are not. Consequences being the possible extra latency or ENOSPC on CoW. You can get all these consequences

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-16 Thread Austin S Hemmelgarn
On 2015-10-16 08:21, Christoph Hellwig wrote: On Fri, Oct 16, 2015 at 07:46:41AM -0400, Austin S Hemmelgarn wrote: I should have been specific, what I meant was that some people will assume that it actually creates a physical, on-disk byte-for-byte copy of the data. There are many people out

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-16 Thread Christoph Hellwig
On Fri, Oct 16, 2015 at 08:50:41AM -0400, Austin S Hemmelgarn wrote: > Certain parts of userspace do try to reflink things instead of copying (for > example, coreutils recently started doing so in mv and has had the option to > do so with cp for a while now), but a properly designed general

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-16 Thread Austin S Hemmelgarn
On 2015-10-16 09:12, Christoph Hellwig wrote: On Fri, Oct 16, 2015 at 08:50:41AM -0400, Austin S Hemmelgarn wrote: Certain parts of userspace do try to reflink things instead of copying (for example, coreutils recently started doing so in mv and has had the option to do so with cp for a while

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-15 Thread Austin S Hemmelgarn
On 2015-10-15 02:36, Christoph Hellwig wrote: On Wed, Oct 14, 2015 at 03:08:46PM -0400, Austin S Hemmelgarn wrote: Whether or not reflink is different from a copy is entirely a matter of who is looking at it. So what? I've been trying to explain why clone semantics matter, and I've not seen

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-15 Thread Christoph Hellwig
On Wed, Oct 14, 2015 at 03:08:46PM -0400, Austin S Hemmelgarn wrote: > Whether or not reflink is different from a copy is entirely a matter of who > is looking at it. So what? I've been trying to explain why clone semantics matter, and I've not seen a counter argument for that. I've also

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-15 Thread Christoph Hellwig
On Thu, Oct 15, 2015 at 08:24:51AM -0400, Austin S Hemmelgarn wrote: > My only point with saying we shouldn't reflink by default is that there are > many (unintelligent) people who will assume that since the syscall has copy > in it's name, that's what it will do; and, while I don't think we

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-14 Thread Christoph Hellwig
On Wed, Oct 14, 2015 at 11:08:40AM -0700, Andy Lutomirski wrote: > > So what I'm hearing is that I should drop the reflink and dedup flags and > > change this system call only perform a full copy (with preserving of > > sparseness), correct? I can make those changes, but only if everybody is >

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-14 Thread Andy Lutomirski
On Wed, Oct 14, 2015 at 11:27 AM, Christoph Hellwig wrote: > On Wed, Oct 14, 2015 at 11:08:40AM -0700, Andy Lutomirski wrote: >> > So what I'm hearing is that I should drop the reflink and dedup flags and >> > change this system call only perform a full copy (with preserving

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-14 Thread Darrick J. Wong
On Wed, Oct 14, 2015 at 01:59:40PM -0400, Anna Schumaker wrote: > On 10/12/2015 07:17 PM, Darrick J. Wong wrote: > > On Sun, Oct 11, 2015 at 07:22:03AM -0700, Christoph Hellwig wrote: > >> On Wed, Sep 30, 2015 at 01:26:52PM -0400, Anna Schumaker wrote: > >>> This allows us to have an in-kernel

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-14 Thread Anna Schumaker
On 10/12/2015 07:17 PM, Darrick J. Wong wrote: > On Sun, Oct 11, 2015 at 07:22:03AM -0700, Christoph Hellwig wrote: >> On Wed, Sep 30, 2015 at 01:26:52PM -0400, Anna Schumaker wrote: >>> This allows us to have an in-kernel copy mechanism that avoids frequent >>> switches between kernel and user

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-14 Thread Christoph Hellwig
On Wed, Oct 14, 2015 at 11:38:13AM -0700, Andy Lutomirski wrote: > One might argue that reflink is like copy + immediate dedupe. Not, it's not. It's all that and more, because it is an operation that is atomic vs other writes to the file and it's an operation that either clones the whole range

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-14 Thread Andy Lutomirski
On Wed, Oct 14, 2015 at 10:59 AM, Anna Schumaker wrote: > On 10/12/2015 07:17 PM, Darrick J. Wong wrote: >> On Sun, Oct 11, 2015 at 07:22:03AM -0700, Christoph Hellwig wrote: >>> On Wed, Sep 30, 2015 at 01:26:52PM -0400, Anna Schumaker wrote: This allows us to have

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-14 Thread Christoph Hellwig
On Tue, Oct 13, 2015 at 04:25:29PM -0400, Anna Schumaker wrote: > I haven't tried it, but I think the hole would be expanded :(. I'm having > splice() handle the pagecache copy part, and (as far as I know) splice() > doesn't know anything about sparse files. I might be able to put in some >

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-14 Thread Austin S Hemmelgarn
On 2015-10-14 14:53, Andy Lutomirski wrote: On Wed, Oct 14, 2015 at 11:49 AM, Christoph Hellwig wrote: On Wed, Oct 14, 2015 at 11:38:13AM -0700, Andy Lutomirski wrote: One might argue that reflink is like copy + immediate dedupe. Not, it's not. It's all that and more,

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-14 Thread Pádraig Brady
On 14/10/15 20:14, Austin S Hemmelgarn wrote: > On 2015-10-14 14:53, Andy Lutomirski wrote: >> On Wed, Oct 14, 2015 at 11:49 AM, Christoph Hellwig >> wrote: >>> On Wed, Oct 14, 2015 at 11:38:13AM -0700, Andy Lutomirski wrote: One might argue that reflink is like copy +

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-14 Thread Andy Lutomirski
On Wed, Oct 14, 2015 at 11:49 AM, Christoph Hellwig wrote: > On Wed, Oct 14, 2015 at 11:38:13AM -0700, Andy Lutomirski wrote: >> One might argue that reflink is like copy + immediate dedupe. > > Not, it's not. It's all that and more, because it is an operation that > is

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-14 Thread Austin S Hemmelgarn
On 2015-10-14 14:27, Christoph Hellwig wrote: On Wed, Oct 14, 2015 at 11:08:40AM -0700, Andy Lutomirski wrote: So what I'm hearing is that I should drop the reflink and dedup flags and change this system call only perform a full copy (with preserving of sparseness), correct? I can make those

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-14 Thread Christoph Hellwig
On Wed, Oct 14, 2015 at 11:53:45AM -0700, Andy Lutomirski wrote: > Would copy_file_range without the reflink option removed still be > permitted to link blocks on supported filesystems (btrfs and maybe > XFS)? Absolutely. Unless the COPY_FALLOCATE or whatever we call it option is specified of

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-13 Thread Darrick J. Wong
On Mon, Oct 12, 2015 at 11:36:31PM -0400, Trond Myklebust wrote: > On Mon, Oct 12, 2015 at 7:17 PM, Darrick J. Wong > wrote: > > On Sun, Oct 11, 2015 at 07:22:03AM -0700, Christoph Hellwig wrote: > >> On Wed, Sep 30, 2015 at 01:26:52PM -0400, Anna Schumaker wrote: > >> >

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-13 Thread Christoph Hellwig
On Mon, Oct 12, 2015 at 04:17:49PM -0700, Darrick J. Wong wrote: > Hm. Peng's patches only generalize the CLONE and CLONE_RANGE ioctls from > btrfs, however they don't port over the (vastly different) EXTENT_SAME ioctl. > > What does everyone think about generalizing EXTENT_SAME? The interface

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-13 Thread Christoph Hellwig
On Mon, Oct 12, 2015 at 11:36:31PM -0400, Trond Myklebust wrote: > How is this supposed to be implemented on something like NFS without > protocol changes? Explicit dedup has no chance of working over NFS or other network protocols without protocol changes. -- To unsubscribe from this list: send

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-13 Thread Anna Schumaker
On 10/09/2015 07:15 AM, Pádraig Brady wrote: > On 08/10/15 02:40, Neil Brown wrote: >> Anna Schumaker writes: >> >>> @@ -1338,34 +1362,26 @@ ssize_t vfs_copy_file_range(struct file *file_in, >>> loff_t pos_in, >>> struct file *file_out, loff_t

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-13 Thread Anna Schumaker
On 10/07/2015 09:40 PM, Neil Brown wrote: > Anna Schumaker writes: > >> @@ -1338,34 +1362,26 @@ ssize_t vfs_copy_file_range(struct file *file_in, >> loff_t pos_in, >> struct file *file_out, loff_t pos_out, >> size_t

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-12 Thread Darrick J. Wong
On Sun, Oct 11, 2015 at 07:22:03AM -0700, Christoph Hellwig wrote: > On Wed, Sep 30, 2015 at 01:26:52PM -0400, Anna Schumaker wrote: > > This allows us to have an in-kernel copy mechanism that avoids frequent > > switches between kernel and user space. This is especially useful so > > NFSD can

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-12 Thread Trond Myklebust
On Mon, Oct 12, 2015 at 7:17 PM, Darrick J. Wong wrote: > On Sun, Oct 11, 2015 at 07:22:03AM -0700, Christoph Hellwig wrote: >> On Wed, Sep 30, 2015 at 01:26:52PM -0400, Anna Schumaker wrote: >> > This allows us to have an in-kernel copy mechanism that avoids frequent >>

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-11 Thread Christoph Hellwig
On Wed, Sep 30, 2015 at 01:26:52PM -0400, Anna Schumaker wrote: > This allows us to have an in-kernel copy mechanism that avoids frequent > switches between kernel and user space. This is especially useful so > NFSD can support server-side copies. > > I make pagecache copies configurable by

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-09 Thread Pádraig Brady
On 08/10/15 02:40, Neil Brown wrote: > Anna Schumaker writes: > >> @@ -1338,34 +1362,26 @@ ssize_t vfs_copy_file_range(struct file *file_in, >> loff_t pos_in, >> struct file *file_out, loff_t pos_out, >> size_t len,

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-07 Thread Neil Brown
Anna Schumaker writes: > @@ -1338,34 +1362,26 @@ ssize_t vfs_copy_file_range(struct file *file_in, > loff_t pos_in, > struct file *file_out, loff_t pos_out, > size_t len, unsigned int flags) > { > - struct inode

[PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-09-30 Thread Anna Schumaker
This allows us to have an in-kernel copy mechanism that avoids frequent switches between kernel and user space. This is especially useful so NFSD can support server-side copies. I make pagecache copies configurable by adding three new (exclusive) flags: - COPY_FR_REFLINK tells