public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: "David Hildenbrand (arm)" <david@kernel.org>,
	Gabriel Krisman Bertazi <krisman@suse.de>
Cc: io-uring@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org
Subject: Re: [PATCH 0/2] Introduce IORING_OP_MMAP
Date: Sun, 1 Feb 2026 11:16:32 -0700	[thread overview]
Message-ID: <f6098b6a-6283-486b-8167-b77c8d2e7880@kernel.dk> (raw)
In-Reply-To: <62d5954b-8ad5-4674-986b-c1168771429b@kernel.org>

On 2/1/26 10:46 AM, David Hildenbrand (arm) wrote:
> On 1/29/26 23:11, Gabriel Krisman Bertazi wrote:
>> Hi,
>>
>> There's been a few requests over time for supporting mmap(2) over
>> io_uring. The reasoning are twofold: 1) serving as base for batching
>> multiple mappings in a single operation 2) supporting mmap of fixed
>> files.
>>
>> Since mmap can operate on either anonymous memory and file descriptors,
>> patch 1 adds support for optional fds in io_uring commands.  Patch 2
>> implements the mmap operation itself.
>>
>> Note this patchset doesn't do any kind of smarter batching in MM.  While
>> we can potentially do some interesting optimizations already, like
>> holding the MM write lock instead of reacquiring it for each mapping, I
>> wanted to focus on the API discussion first.  This is left as future
>> work.
>>
>> liburing support, including testcases, will be sent shortly to the list,
>> but can also be found at:
> 
> Just a general question: why do we unlock each syscall individually,
> and not in some intelligent way, all syscalls at once? :)

The hard part isn't enabling all syscalls at once, that could be
trivially done with an IORING_OP_SYSCALL and the SQE carries arg0..argN.
And for any nonblocking/simple syscall, that would Just Work. The
challenge is for syscalls that block - the whole point of io_uring is
that you should be able to do nonblock issues with sane retries. The
futex series I did some time back is a good example of that - you modify
the existing syscall to expose the waitqueue mechanism, which you can
then use to wait in an async way, and get a callback when some action
needs to be taken.

If you just allow blocking, then you're blocking the entire io_uring
issue pipeline. Which was exactly my main complaint on this patchset,
see the review reply to patch 2.

> I assume supporting arbitrary syscalls could be rather hard (or am I
> wrong? :) ).

See above - it's both trivially easy if you ignore the problems, or
somewhat harder as you'd need to refactor the underlying bits of that
particular syscall first. For some of them, that's hard. Traditionally
syscalls have been fully sync, they will just block and prevent the task
from returning back to userspace until they are done. syscalls with
io_uring is more involved as we simply cannot allow that kind of
blocking.

-- 
Jens Axboe

      reply	other threads:[~2026-02-01 18:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 22:11 [PATCH 0/2] Introduce IORING_OP_MMAP Gabriel Krisman Bertazi
2026-01-29 22:11 ` [PATCH 1/2] io_uring: Support commands with optional file descriptors Gabriel Krisman Bertazi
2026-01-29 22:11 ` [PATCH 2/2] io_uring: introduce IORING_OP_MMAP Gabriel Krisman Bertazi
2026-01-30  6:03   ` kernel test robot
2026-01-30 15:47     ` Gabriel Krisman Bertazi
2026-01-30 15:55   ` Jens Axboe
2026-02-01 17:46 ` [PATCH 0/2] Introduce IORING_OP_MMAP David Hildenbrand (arm)
2026-02-01 18:16   ` Jens Axboe [this message]

Reply instructions:

You may reply publicly 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=f6098b6a-6283-486b-8167-b77c8d2e7880@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=io-uring@vger.kernel.org \
    --cc=krisman@suse.de \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox