linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] sys_ringbuffer
@ 2024-06-03  0:32 Kent Overstreet
  2024-06-03  0:32 ` [PATCH 1/5] darray: lift from bcachefs Kent Overstreet
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Kent Overstreet @ 2024-06-03  0:32 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel
  Cc: Jens Axboe, Kent Overstreet, brauner, viro, Bernd Schubert,
	linux-mm, Josef Bacik

New syscall for mapping generic ringbuffers for arbitary (supported)
file descriptors.

Ringbuffers can be created either when requested or at file open time,
and can be mapped into multiple address spaces (naturally, since files
can be shared as well).

Initial motivation is for fuse, but I plan on adding support to pipes
and possibly sockets as well - pipes are a particularly interesting use
case, because if both the sender and receiver of a pipe opt in to the
new ringbuffer interface, we can make them the _same_ ringbuffer for
true zero copy IO, while being backwards compatible with existing pipes.

the ringbuffer_wait and ringbuffer_wakeup syscalls are probably going
away in a future iteration, in favor of just using futexes.

In my testing, reading/writing from the ringbuffer 16 bytes at a time is
~7x faster than using read/write syscalls - and I was testing with
mitigations off, real world benefit will be even higher.

Kent Overstreet (5):
  darray: lift from bcachefs
  darray: Fix darray_for_each_reverse() when darray is empty
  fs: sys_ringbuffer
  ringbuffer: Test device
  ringbuffer: Userspace test helper

 MAINTAINERS                             |   7 +
 arch/x86/entry/syscalls/syscall_32.tbl  |   3 +
 arch/x86/entry/syscalls/syscall_64.tbl  |   3 +
 fs/Makefile                             |   2 +
 fs/bcachefs/Makefile                    |   1 -
 fs/bcachefs/btree_types.h               |   2 +-
 fs/bcachefs/btree_update.c              |   2 +
 fs/bcachefs/btree_write_buffer_types.h  |   2 +-
 fs/bcachefs/fsck.c                      |   2 +-
 fs/bcachefs/journal_io.h                |   2 +-
 fs/bcachefs/journal_sb.c                |   2 +-
 fs/bcachefs/sb-downgrade.c              |   3 +-
 fs/bcachefs/sb-errors_types.h           |   2 +-
 fs/bcachefs/sb-members.h                |   3 +-
 fs/bcachefs/subvolume.h                 |   1 -
 fs/bcachefs/subvolume_types.h           |   2 +-
 fs/bcachefs/thread_with_file_types.h    |   2 +-
 fs/bcachefs/util.h                      |  28 +-
 fs/ringbuffer.c                         | 474 ++++++++++++++++++++++++
 fs/ringbuffer_test.c                    | 209 +++++++++++
 {fs/bcachefs => include/linux}/darray.h |  61 +--
 include/linux/darray_types.h            |  22 ++
 include/linux/fs.h                      |   2 +
 include/linux/mm_types.h                |   4 +
 include/linux/ringbuffer_sys.h          |  18 +
 include/uapi/linux/futex.h              |   1 +
 include/uapi/linux/ringbuffer_sys.h     |  40 ++
 init/Kconfig                            |   9 +
 kernel/fork.c                           |   2 +
 lib/Kconfig.debug                       |   5 +
 lib/Makefile                            |   2 +-
 {fs/bcachefs => lib}/darray.c           |  12 +-
 tools/ringbuffer/Makefile               |   3 +
 tools/ringbuffer/ringbuffer-test.c      | 254 +++++++++++++
 34 files changed, 1125 insertions(+), 62 deletions(-)
 create mode 100644 fs/ringbuffer.c
 create mode 100644 fs/ringbuffer_test.c
 rename {fs/bcachefs => include/linux}/darray.h (63%)
 create mode 100644 include/linux/darray_types.h
 create mode 100644 include/linux/ringbuffer_sys.h
 create mode 100644 include/uapi/linux/ringbuffer_sys.h
 rename {fs/bcachefs => lib}/darray.c (56%)
 create mode 100644 tools/ringbuffer/Makefile
 create mode 100644 tools/ringbuffer/ringbuffer-test.c

-- 
2.45.1


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

end of thread, other threads:[~2024-06-24  0:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-03  0:32 [PATCH 0/5] sys_ringbuffer Kent Overstreet
2024-06-03  0:32 ` [PATCH 1/5] darray: lift from bcachefs Kent Overstreet
2024-06-03  0:32 ` [PATCH 2/5] darray: Fix darray_for_each_reverse() when darray is empty Kent Overstreet
2024-06-03  0:33 ` [PATCH 3/5] fs: sys_ringbuffer Kent Overstreet
2024-06-03  4:16   ` kernel test robot
2024-06-03  4:38   ` kernel test robot
2024-06-23 22:13   ` Thomas Gleixner
2024-06-23 22:21     ` Kent Overstreet
2024-06-23 23:16       ` Thomas Gleixner
2024-06-24  0:27         ` Kent Overstreet
2024-06-03  0:33 ` [PATCH 4/5] ringbuffer: Test device Kent Overstreet
2024-06-03  0:33 ` [PATCH 5/5] ringbuffer: Userspace test helper Kent Overstreet
2024-06-07  1:49 ` [PATCH 0/5] sys_ringbuffer Stefan Hajnoczi

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