linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/9] VFS: In-kernel copy system call
@ 2015-09-25 20:48 Anna Schumaker
  2015-09-25 20:48 ` [PATCH v3 1/9] vfs: add copy_file_range syscall and vfs helper Anna Schumaker
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: Anna Schumaker @ 2015-09-25 20:48 UTC (permalink / raw)
  To: linux-nfs-u79uwXL29TY76Z2rM5mHXA,
	linux-btrfs-u79uwXL29TY76Z2rM5mHXA,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
	linux-api-u79uwXL29TY76Z2rM5mHXA, zab-ugsP4Wv/S6ZeoWH0uzbU5w,
	viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn, clm-b10kYP2dOMg,
	darrick.wong-QHcLZuEGTsvQT0dZR+AlfA,
	mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	andros-HgOvQuBEEgTQT0dZR+AlfA, hch-wEGCiKHe2LqWVfeAwA7xHQ

Copy system calls came up during Plumbers a while ago, mostly 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. 

The question has come up about how vfs_copy_file_range() responds to signals,
and I don't have a good answer.  The pagecache copy option uses splice,
which (as far as I can tell) doesn't get interrupted.  Please let me know if
I'm missing something or completely misunderstanding the question!

Changes in v3:
- Update against the most recent Linus kernel
- Flags parameter should be an unsigned int
- Add COPY_FR_DEDUPE flag for Darrick
- Make each flag exclusive
- Update man page
- Added "Reiewed-by" tags

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. Values in the
tables below are averages across multiple trials.

 /usr/bin/cp |   512  |  1024  |  1536  |  2048  |  2560  |  3072  |  5120
-------------|--------|--------|--------|--------|--------|--------|--------
        user |  0.00s |  0.00s |  0.01s |  0.01s |  0.01s |  0.01s |  0.02s
      system |  0.92s |  0.59s |  0.88s |  1.18s |  1.48s |  1.78s |  2.98s
         cpu |    43% |    18% |    17% |    18% |    18% |    18% |    17%
       total |  2.116 |  3.200 |  4.950 |  6.541 |  8.105 |  9.811 | 17.211


    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.80s |  0.56s |  0.84s |  1.10s |  1.39s |  1.67s |  2.81s
         cpu |    41% |    18% |    19% |    17% |    17% |    17% |    17%
       total |  1.922 |  2.990 |  4.448 |  6.292 |  7.855 |  9.480 | 15.944

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                        | 141 +++++++++++++++++++++++++++++++++
 include/linux/copy.h                   |   6 ++
 include/linux/fs.h                     |   3 +
 include/uapi/asm-generic/unistd.h      |   2 +
 include/uapi/linux/Kbuild              |   1 +
 include/uapi/linux/copy.h              |   8 ++
 kernel/sys_ni.c                        |   1 +
 12 files changed, 224 insertions(+), 39 deletions(-)
 create mode 100644 include/linux/copy.h
 create mode 100644 include/uapi/linux/copy.h

-- 
2.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

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

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-25 20:48 [PATCH v3 0/9] VFS: In-kernel copy system call Anna Schumaker
2015-09-25 20:48 ` [PATCH v3 1/9] vfs: add copy_file_range syscall and vfs helper Anna Schumaker
2015-09-25 20:48 ` [PATCH v3 2/9] x86: add sys_copy_file_range to syscall tables Anna Schumaker
2015-09-25 20:48 ` [PATCH v3 3/9] btrfs: add .copy_file_range file operation Anna Schumaker
2015-09-25 20:48 ` [PATCH v3 4/9] vfs: Copy should check len after file open mode Anna Schumaker
2015-09-25 20:48 ` [PATCH v3 5/9] vfs: Copy shouldn't forbid ranges inside the same file Anna Schumaker
2015-09-28 18:46   ` Darrick J. Wong
     [not found] ` <1443214096-12769-1-git-send-email-Anna.Schumaker-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
2015-09-25 20:48   ` [PATCH v3 6/9] vfs: Copy should use file_out rather than file_in Anna Schumaker
2015-09-25 20:48 ` [PATCH v3 7/9] vfs: Remove copy_file_range mountpoint checks Anna Schumaker
2015-09-25 20:48 ` [PATCH v3 8/9] vfs: copy_file_range() can do a pagecache copy with splice Anna Schumaker
     [not found]   ` <1443214096-12769-9-git-send-email-Anna.Schumaker-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
2015-09-25 21:58     ` Pádraig Brady
2015-09-28 18:31     ` Darrick J. Wong
     [not found]       ` <20150928183152.GB850-PTl6brltDGh4DFYR7WNSRA@public.gmane.org>
2015-09-28 18:35         ` Anna Schumaker
2015-09-26  0:14   ` Andy Lutomirski
2015-09-28 14:28     ` Anna Schumaker
2015-09-25 20:48 ` [PATCH v3 9/9] btrfs: btrfs_copy_file_range() only supports reflinks Anna Schumaker
2015-09-25 20:48 ` [PATCH v3 10/9] copy_file_range.2: New page documenting copy_file_range() Anna Schumaker
2015-09-28 18:40   ` Darrick J. Wong
2015-09-28 20:42     ` 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).