From: Jens Axboe <[email protected]>
To: Daurnimator <[email protected]>
Cc: io-uring <[email protected]>
Subject: Re: [PATCH] io_uring: prevent eventfd recursion on poll
Date: Tue, 4 Feb 2020 11:57:40 -0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAEnbY+cUeNGLOHj2O9VughT8c6A_T4w5qG_nSen=P=fOivfMMA@mail.gmail.com>
On 2/4/20 2:38 AM, Daurnimator wrote:
> On Fri, 31 Jan 2020 at 16:25, Jens Axboe <[email protected]> wrote:
>>
>> If we register an eventfd with io_uring for completion notification,
>> and then subsequently does a poll for that very descriptor, then we
>> can trigger a deadlock scenario. Once a request completes and signals
>> the eventfd context, that will in turn trigger the poll command to
>> complete. When that poll request completes, it'll try trigger another
>> event on the eventfd, but this time off the path led us to complete
>> the poll in the first place. The result is a deadlock in eventfd,
>> as it tries to ctx->wqh.lock in a nested fashion.
>>
>> Check if the file in question for the poll request is our eventfd
>> context, and if it is, don't trigger a nested event for the poll
>> completion.
>
> Could this deadlock/loop also happen via an epoll fd?
No, only through io_uring and aio with the way they handle the
notification through a (potentially nested) waitqueue wakeup
handler.
--
Jens Axboe
prev parent reply other threads:[~2020-02-04 18:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-31 5:24 [PATCH] io_uring: prevent eventfd recursion on poll Jens Axboe
2020-02-04 9:38 ` Daurnimator
2020-02-04 18:57 ` 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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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