On Fri, 31 Jan 2020 at 16:25, Jens Axboe <axboe@xxxxxxxxx> 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?