From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, Aarushi Mehta <mehta.aaru20@gmail.com>,
Stefano Garzarella <sgarzare@redhat.com>,
surajshirvankar@gmail.com, Hanna Reitz <hreitz@redhat.com>,
qemu-block@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Fam Zheng <fam@euphon.net>
Subject: Re: [PATCH 1/3] aio-posix: treat io_uring setup failure as fatal
Date: Fri, 25 Apr 2025 17:51:43 +0200 [thread overview]
Message-ID: <aAuvjznKfL1qg2J7@redhat.com> (raw)
In-Reply-To: <20250401142721.280287-2-stefanha@redhat.com>
Am 01.04.2025 um 16:27 hat Stefan Hajnoczi geschrieben:
> In the early days of io_uring it was possible for io_uring_setup(2) to
> fail due to exhausting RLIMIT_MEMLOCK. QEMU's solution was to fall back
> to epoll(7) or ppoll(2) when io_uring could not be used in an
> AioContext.
>
> Nowadays io_uring memory is accounted differently so io_uring_setup(2)
> won't fail. Treat failure as a fatal error. Keep it simple: io_uring is
> available if and only if CONFIG_LINUX_IO_URING is defined.
>
> Upcoming features that rely on io_uring won't need to handle the case
> where a subset of AioContexts lacks io_uring. This will simplify the
> aio_add_sqe() API introduced in the next commit.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
While making failure to set up io_uring for an AioContext a hard error
feels fine to me, I feel a bit uneasy about having fatal errors like
this in functions that aren't only called during startup. This function
is also called when adding an iothread object at runtime. The failure
mode that I would expect there is that object-add returns an error, not
that the whole QEMU process exits.
Kevin
next prev parent reply other threads:[~2025-04-25 15:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-01 14:27 [PATCH 0/3] [RESEND] block: unify block and fdmon io_uring Stefan Hajnoczi
2025-04-01 14:27 ` [PATCH 1/3] aio-posix: treat io_uring setup failure as fatal Stefan Hajnoczi
2025-04-25 15:51 ` Kevin Wolf [this message]
2025-04-28 18:35 ` Stefan Hajnoczi
2025-04-01 14:27 ` [PATCH 2/3] aio-posix: add aio_add_sqe() API for user-defined io_uring requests Stefan Hajnoczi
2025-04-01 14:27 ` [PATCH 3/3] block/io_uring: use aio_add_sqe() Stefan Hajnoczi
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=aAuvjznKfL1qg2J7@redhat.com \
--to=kwolf@redhat.com \
--cc=fam@euphon.net \
--cc=hreitz@redhat.com \
--cc=mehta.aaru20@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=stefanha@redhat.com \
--cc=surajshirvankar@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).