[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d52435c0-54dc-0fbb-81b4-b2be0b834ffc@samba.org>
Date: Wed, 8 Jan 2020 14:26:46 +0100
From: Stefan Metzmacher <metze@...ba.org>
To: Jens Axboe <axboe@...nel.dk>,
Pavel Begunkov <asml.silence@...il.com>,
Jann Horn <jannh@...gle.com>
Cc: io-uring <io-uring@...r.kernel.org>,
kernel list <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] io_uring: add support for IORING_OP_IOCTL
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
>
> IORING_OP_IOCTL
>
> 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.
Thanks!
metze
Powered by blists - more mailing lists