linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/9] VFS: In-kernel copy system call
@ 2015-09-11 20:30 Anna Schumaker
  2015-09-11 20:30 ` [PATCH v2 1/9] vfs: add copy_file_range syscall and vfs helper Anna Schumaker
                   ` (8 more replies)
  0 siblings, 9 replies; 28+ messages in thread
From: Anna Schumaker @ 2015-09-11 20:30 UTC (permalink / raw)
  To: linux-nfs, linux-btrfs, linux-fsdevel, linux-api, zab, viro, clm,
	darrick.wong, mtk.manpages, andros, hch

Copy system calls came up during Plumbers a couple of weeks ago, because
several filesystems (including NFS and XFS) are currently working on copy
acceleration implementations.  We haven't heard from Zach Brown in a while,
so I volunteered to push his patches upstream so individual filesystems
don't need to keep writing their own ioctls.

Changes in v2:
- Update against the most recent Linus kernel
  - Fix conflicts due to new system calls
- Remove requirement that inode_in == inode_out
- Drop patch to add mountpoint checking to btrfs
  - btrfs already did this check
- Rename COPY_REFLINK -> COPY_FR_REFLINK
- Add COPY_FR_COPY flag
- Expand flags == 0 to (COPY_FR_COPY | COPY_FR_REFLINK)
- Remove checking for invalid flags
- Create a new function for handling pagecache copies
- Move rw_verify_area() checks into the new pagecache-copy function
  - Use the return value from rw_verify_area() to set amount of data to copy
- Update man page

I tested the COPY_FR_COPY flag by using /dev/urandom to generate files of
varying sizes and copying them.  I compared the output from `time` against
that of `cp` to see if there is any noticable difference.  I think there
have been some libvirt changes since my first set of trials, because this
time around cpu usage was down significantly.  This time around, VFS copy
was slightly faster than /usr/bin/cp in all cases.  Values in the tables
below are averages across multiple trials.


 /usr/bin/cp |   512  |  1024  |  1536  |  2048  |  2560  |  3072  |  5120
-------------|--------|--------|--------|--------|--------|--------|--------
        user |  0.00s |  0.01s |  0.01s |  0.01s |  0.01s |  0.01s |  0.02s
      system |  0.68s |  0.48s |  0.74s |  0.99s |  1.25s |  1.50s |  2.51s
         cpu |    34% |    14% |    14% |    15% |    14% |    14% |    15%
       total |  1.993 |  3.314 |  4.994 |  6.599 |  8.627 | 10.079 | 16.852


    VFS copy |   512  |  1024  |  1536  |  2048  |  2560  |  3072  |  5120
-------------|--------|--------|--------|--------|--------|--------|--------
        user |  0.00s |  0.00s |  0.00s |  0.00s |  0.00s |  0.00s |  0.00s
      system |  0.65s |  0.46s |  0.70s |  0.93s |  1.18s |  1.41s |  2.37s
         cpu |    35% |    14% |    15% |    14% |    14% |    14% |    14%
       total |  1.870 |  3.084 |  4.613 |  6.206 |  7.884 |  9.372 | 15.904


Questions?  Comments?  Thoughts?

Anna


Anna Schumaker (6):
  vfs: Copy should check len after file open mode
  vfs: Copy shouldn't forbid ranges inside the same file
  vfs: Copy should use file_out rather than file_in
  vfs: Remove copy_file_range mountpoint checks
  vfs: copy_file_range() can do a pagecache copy with splice
  btrfs: btrfs_copy_file_range() only supports reflinks

Zach Brown (3):
  vfs: add copy_file_range syscall and vfs helper
  x86: add sys_copy_file_range to syscall tables
  btrfs: add .copy_file_range file operation

 arch/x86/entry/syscalls/syscall_32.tbl |   1 +
 arch/x86/entry/syscalls/syscall_64.tbl |   1 +
 fs/btrfs/ctree.h                       |   3 +
 fs/btrfs/file.c                        |   1 +
 fs/btrfs/ioctl.c                       |  95 ++++++++++++++----------
 fs/read_write.c                        | 132 +++++++++++++++++++++++++++++++++
 include/linux/copy.h                   |   6 ++
 include/linux/fs.h                     |   3 +
 include/uapi/asm-generic/unistd.h      |   4 +-
 include/uapi/linux/Kbuild              |   1 +
 include/uapi/linux/copy.h              |   7 ++
 kernel/sys_ni.c                        |   1 +
 12 files changed, 215 insertions(+), 40 deletions(-)
 create mode 100644 include/linux/copy.h
 create mode 100644 include/uapi/linux/copy.h

-- 
2.5.1


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

end of thread, other threads:[~2015-09-28 17:23 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-11 20:30 [PATCH v2 0/9] VFS: In-kernel copy system call Anna Schumaker
2015-09-11 20:30 ` [PATCH v2 1/9] vfs: add copy_file_range syscall and vfs helper Anna Schumaker
     [not found]   ` <1442003423-6884-2-git-send-email-Anna.Schumaker-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
2015-09-22 11:44     ` David Sterba
     [not found]       ` <20150922114404.GF8891-1ReQVI26iDCaZKY3DrU6dA@public.gmane.org>
2015-09-22 18:27         ` Anna Schumaker
2015-09-11 20:30 ` [PATCH v2 2/9] x86: add sys_copy_file_range to syscall tables Anna Schumaker
2015-09-11 20:30 ` [PATCH v2 3/9] btrfs: add .copy_file_range file operation Anna Schumaker
2015-09-11 20:30 ` [PATCH v2 4/9] vfs: Copy should check len after file open mode Anna Schumaker
     [not found]   ` <1442003423-6884-5-git-send-email-Anna.Schumaker-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
2015-09-22 11:47     ` David Sterba
     [not found] ` <1442003423-6884-1-git-send-email-Anna.Schumaker-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
2015-09-11 20:30   ` [PATCH v2 5/9] vfs: Copy shouldn't forbid ranges inside the same file Anna Schumaker
2015-09-22 11:48     ` David Sterba
2015-09-11 20:30   ` [PATCH v2 8/9] vfs: copy_file_range() can do a pagecache copy with splice Anna Schumaker
2015-09-15  3:32     ` Darrick J. Wong
     [not found]       ` <20150915033217.GG10391-PTl6brltDGh4DFYR7WNSRA@public.gmane.org>
2015-09-15 15:58         ` Anna Schumaker
     [not found]           ` <55F8400C.3000402-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
2015-09-15 16:38             ` Darrick J. Wong
     [not found]               ` <20150915163829.GA12658-PTl6brltDGh4DFYR7WNSRA@public.gmane.org>
2015-09-15 17:01                 ` Austin S Hemmelgarn
2015-09-11 20:30 ` [PATCH v2 6/9] vfs: Copy should use file_out rather than file_in Anna Schumaker
2015-09-11 20:30 ` [PATCH v2 7/9] vfs: Remove copy_file_range mountpoint checks Anna Schumaker
2015-09-22 11:52   ` David Sterba
2015-09-11 20:30 ` [PATCH v2 9/9] btrfs: btrfs_copy_file_range() only supports reflinks Anna Schumaker
2015-09-22 11:56   ` David Sterba
2015-09-11 20:30 ` [PATCH v2 10/9] copy_file_range.2: New page documenting copy_file_range() Anna Schumaker
2015-09-13  7:50   ` Michael Kerrisk (man-pages)
     [not found]     ` <55F52ABA.9070908-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-14 18:32       ` Darrick J. Wong
     [not found]         ` <20150914183223.GA28469-PTl6brltDGh4DFYR7WNSRA@public.gmane.org>
2015-09-22 20:10           ` Anna Schumaker
2015-09-22 20:30             ` Pádraig Brady
2015-09-28 17:23             ` Darrick J. Wong
2015-09-14 19:02     ` Austin S Hemmelgarn
2015-09-22 20:30     ` Anna Schumaker

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