All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] ovl: efficient copy up by reflink
@ 2016-09-14 12:43 Amir Goldstein
  2016-09-14 12:43 ` [PATCH v3 1/4] vfs: allow vfs_clone_file_range() across mount points Amir Goldstein
                   ` (4 more replies)
  0 siblings, 5 replies; 28+ messages in thread
From: Amir Goldstein @ 2016-09-14 12:43 UTC (permalink / raw)
  To: Miklos Szeredi, Dave Chinner, linux-unionfs
  Cc: Christoph Hellwig, linux-xfs, Darrick J . Wong, linux-fsdevel

This is the 3rd revision of implementing overlayfs
copy up by reflink.

Btrfs has file reflink support and XFS is about to gain
file reflink support soon. It is very useful to use reflink
to implement copy up of regular file data when possible.

For example, on my laptop, xfstest overlay/001 (copy up of 4G
sparse files) takes less than 1 second with copy up by reflink
vs. 25 seconds with regular copy up.

This series includes two pairs of patches:
- patches 1,2 utilize the clone_file_range() API
- patches 3,4 utilize the copy_file_range() API

The two pairs of patches are independent of each other.
They were each tested separately and both tested together.
All combinations passed the unionmount-testsuite (over tmpfs)
All combinations passed the overlay/??? xfstests over the
following underlying fs:
1. ext4 (copy up)
2. xfs + reflink patches + mkfs.xfs (copy up)
3. xfs + reflink patches + mkfs.xfs -m reflink=1 (reflink up)

Dave Chinner suggested the following implementation for copy up,
which I implemented in this series:
1. try to clone_file_range() entire length
2. fallback to trying copy_file_range() in small chunks
3. fallback to do_splice_direct() in small chunks

This is a good general implementation to cover the future use cases of
file systems that can do either clone_file_range() or copy_file_range().
However, currently, the only in-tree file systems that support
clone/copy_file_range are btrfs, xfs (soon), cifs and nfs.
btrfs and xfs use the same implementation for clone and copy range,
so the copy_file_range() step is never needed.
cifs supports only clone_file_range() so copy_file_range() step is moot.
nfs does have a different implementation for clone_file_range() and
copy_file_range(), but nfs is not supported as upper layer for overlayfs
at the moment.

Please pick patches 1,2 for clear and immediate benefit to copy up
performance on filesystems with reflink support.

Please consider picking patches 3,4 additionally for future generations
and for code consolidation into vfs helpers.

Cheers,
Amir.

V3:
- Address style comments from Dave Chinner

V2:
- Re-factor vfs helpers so they can be called from copy up
- Single call to vfs_clone_file_range() and fallback to
  vfs_copy_file_range() loop

V1:
- Replace iteravite call to copy_file_range() with
  a single call to clone_file_range()

V0:
- Call clone_file_range() and fallback to do_splice_direct()

Amir Goldstein (4):
  vfs: allow vfs_clone_file_range() across mount points
  ovl: use vfs_clone_file_range() for copy up if possible
  vfs: allow vfs_copy_file_range() across file systems
  ovl: use vfs_copy_file_range() to copy up file data

 fs/ioctl.c             |  2 ++
 fs/overlayfs/copy_up.c | 22 ++++++++++++++++------
 fs/read_write.c        | 25 ++++++++++++++++++-------
 3 files changed, 36 insertions(+), 13 deletions(-)

-- 
2.7.4


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

end of thread, other threads:[~2016-09-30 11:14 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-14 12:43 [PATCH v3 0/4] ovl: efficient copy up by reflink Amir Goldstein
2016-09-14 12:43 ` [PATCH v3 1/4] vfs: allow vfs_clone_file_range() across mount points Amir Goldstein
2016-09-14 12:43 ` [PATCH v3 2/4] ovl: use vfs_clone_file_range() for copy up if possible Amir Goldstein
2016-09-21 15:09   ` Miklos Szeredi
2016-09-21 17:01     ` Amir Goldstein
2016-09-21 18:29       ` Miklos Szeredi
2016-09-29  9:00         ` Amir Goldstein
2016-09-30 11:14           ` Miklos Szeredi
2016-09-21 21:48       ` Dave Chinner
2016-09-21 21:57         ` Al Viro
2016-09-21 22:33           ` Dave Chinner
2016-09-22  2:25             ` Darrick J. Wong
2016-09-22  2:52               ` Amir Goldstein
2016-09-14 12:43 ` [PATCH v3 3/4] vfs: allow vfs_copy_file_range() across file systems Amir Goldstein
2016-09-23  7:57   ` Amir Goldstein
2016-09-23 15:19     ` Darrick J. Wong
2016-09-23 16:13     ` Darrick J. Wong
2016-09-23 18:52       ` Amir Goldstein
2016-09-24 15:06         ` Darrick J. Wong
2016-09-26 16:33         ` Darrick J. Wong
2016-09-26 18:12           ` Amir Goldstein
2016-09-26 18:16             ` Darrick J. Wong
2016-09-14 12:43 ` [PATCH v3 4/4] ovl: use vfs_copy_file_range() to copy up file data Amir Goldstein
2016-09-22  8:49   ` Amir Goldstein
2016-09-22 14:49     ` Miklos Szeredi
2016-09-22 15:44       ` Amir Goldstein
2016-09-22 17:21         ` Amir Goldstein
2016-09-19 18:55 ` [PATCH v3 0/4] ovl: efficient copy up by reflink Amir Goldstein

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.