IO-Uring Archive on
 help / color / Atom feed
From: Stefan Metzmacher <>
To: Jens Axboe <>,
	Pavel Begunkov <>,
	Jann Horn <>
Cc: io-uring <>,
	kernel list <>
Subject: Re: [RFC PATCH] io_uring: add support for IORING_OP_IOCTL
Date: Wed, 8 Jan 2020 14:26:46 +0100
Message-ID: <> (raw)
In-Reply-To: <>

Hi Jens,

> While the ioctl approach is tempting, for the use cases where it makes
> sense, I think we should just add a ioctl type opcode and have the
> sub-opcode be somewhere else in the sqe. Because I do think there's
> a large opportunity to expose a fast API that works with ioctl like
> mechanisms. If we have
> and set aside an sqe field for the per-driver (or per-user) and
> add a file_operations method for sending these to the fd, then we'll
> have a much better (and faster + async) API than ioctls. We could
> add fops->uring_issue() or something, and that passes the io_kiocb.
> When it completes, the ->io_uring_issue() posts a completion by
> calling io_uring_complete_req() or something.
> Outside of the issues that Jann outlined, ioctls are also such a
> decade old mess that we have to do the -EAGAIN punt for all of them
> like you did in your patch. If it's opt-in like ->uring_issue(), then
> care could be taken to do this right and just have it return -EAGAIN
> if it does need async context.
> ret = fops->uring_issue(req, force_nonblock);
> if (ret == -EAGAIN) {
> 	... usual punt ...
> }
> I think working on this would be great, and some of the more performance
> sensitive ioctl cases should flock to it.

I could use also use a generic way for an async fd-based syscall.
I thought about using sendmsg() with special CMSG_ elements, but
currently it's not possible with IORING_OP_SENDMSG to do an async
io_kiocb based completion, using msg_iocb.

My use case would be samba triggering async sendfile-like io for
the SMB-Direct protocol, doing multiple async file io operations
followed by RDMA-WRITE operations as a single async syscall from userspace.


      parent reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-14 15:29 Pavel Begunkov
2019-12-14 17:12 ` Jann Horn
2019-12-14 17:56   ` Pavel Begunkov
2019-12-14 18:52     ` Jens Axboe
2019-12-15 15:40       ` Pavel Begunkov
2020-01-08 13:26       ` Stefan Metzmacher [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

IO-Uring Archive on

Archives are clonable:
	git clone --mirror io-uring/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 io-uring io-uring/ \
	public-inbox-index io-uring

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone