From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, remy.noel@blade-group.com
Cc: qemu-devel@nongnu.org, Fam Zheng <famz@redhat.com>,
Stefan Weil <sw@weilnetz.de>
Subject: Re: [Qemu-devel] [QEMU-devel][PATCH v4 0/2] Fix concurrent aio_poll/set_fd_handler.
Date: Fri, 21 Dec 2018 12:34:03 +0100 [thread overview]
Message-ID: <44649c49-6d9f-a839-32f1-1cce9766da17@redhat.com> (raw)
In-Reply-To: <20181220163738.GA5662@stefanha-x1.localdomain>
[-- Attachment #1: Type: text/plain, Size: 1483 bytes --]
On 20/12/18 17:37, Stefan Hajnoczi wrote:
> On Thu, Dec 20, 2018 at 04:20:28PM +0100, remy.noel@blade-group.com wrote:
>> From: Remy Noel <remy.noel@blade-group.com>
>>
>> It is possible for an io_poll/read/write callback to be concurrently executed along
>> with an aio_set_fd_handlers. This can cause all sorts of problems, like
>> a NULL callback or a bad opaque pointer.
>>
>> V2:
>> * Do not use RCU anymore as it inccurs a performance loss
>> V3:
>> * Don't drop revents when a handler is modified [Stefan]
>> V4:
>> * Unregister fd from ctx epoll when removing fd_handler [Paolo]
>>
>> Remy Noel (2):
>> aio-posix: Unregister fd from ctx epoll when removing fd_handler.
>> aio-posix: Fix concurrent aio_poll/set_fd_handler.
>>
>> util/aio-posix.c | 90 +++++++++++++++++++++++++++++-------------------
>> util/aio-win32.c | 67 ++++++++++++++++-------------------
>> 2 files changed, 84 insertions(+), 73 deletions(-)
>>
>> --
>> 2.19.2
>>
>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
FWIW, I had missed the early version that used RCU, but lockcnt is
already very RCU-like, so not using RCU is the right thing to do. The
difference between lockcnt and RCU is that cleanup is done by the reader
instead of a separate thread. Because we know that reader/writer
concurrency is very rare for AioContext handlers, the tradeoffs favor
lockcnt over RCU.
Paolo
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2018-12-21 11:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-20 15:20 [Qemu-devel] [QEMU-devel][PATCH v4 0/2] Fix concurrent aio_poll/set_fd_handler remy.noel
2018-12-20 15:20 ` [Qemu-devel] [QEMU-devel][PATCH v4 1/2] aio-posix: Unregister fd from ctx epoll when removing fd_handler remy.noel
2018-12-20 15:20 ` [Qemu-devel] [QEMU-devel][PATCH v4 2/2] aio-posix: Fix concurrent aio_poll/set_fd_handler remy.noel
2018-12-20 16:37 ` [Qemu-devel] [QEMU-devel][PATCH v4 0/2] " Stefan Hajnoczi
2018-12-21 11:34 ` Paolo Bonzini [this message]
2018-12-24 12:38 ` Remy NOEL
2019-01-07 19:04 ` remy.noel
2019-01-08 15:43 ` Stefan Hajnoczi
2019-01-12 8:30 ` Stefan Hajnoczi
2019-01-14 9:48 ` remy.noel
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=44649c49-6d9f-a839-32f1-1cce9766da17@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=remy.noel@blade-group.com \
--cc=stefanha@redhat.com \
--cc=sw@weilnetz.de \
/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).