From nobody Fri Nov 14 06:38:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585839483; cv=none; d=zohomail.com; s=zohoarc; b=N1ivygS+G9XC9DM9uCs6WehEwMquz1tcPdws4HMWI5tACcsm46Iiq8gVGxpOd0UtcKRup+2dZKA9wNw+BMyWSKTj0ZRK6n8ktyy7dNV7qkONUujidVEeJNsOd7yW26c8fJibhLKvsDP5uVmaqqCUPZQlqWpioc/X/QShkPJ0MOc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585839483; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=EQd/tAWeF/YV2ZgjjIRKrDKai5RAA8QDSkAEaREc33E=; b=Ja9AncK++NJaH/DoKC9LfEX4y1ZlK7x/EnyG5TBZJ+iEsz0K2dhDRXt6HGzBpZAJ+jqFzTpB0Pzi/6JqI2ehcgDDhMvW7OJNVxnoGqMZeHeG6LGP8WP3nXYhsEU9ekWkFgkxYGHtZtFBZ0h9+Qk+bRIc1dIJ4NSb2+o+uF5zZrc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585839483762368.86125854205886; Thu, 2 Apr 2020 07:58:03 -0700 (PDT) Received: from localhost ([::1]:41972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK1IA-00033V-Jl for importer@patchew.org; Thu, 02 Apr 2020 10:58:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40886) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK1F1-0005ak-Ru for qemu-devel@nongnu.org; Thu, 02 Apr 2020 10:54:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jK1F0-0001l8-SN for qemu-devel@nongnu.org; Thu, 02 Apr 2020 10:54:47 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:29429 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jK1F0-0001kj-Oj for qemu-devel@nongnu.org; Thu, 02 Apr 2020 10:54:46 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-455-dNKkYIcYP5CP9Dk26D4eZA-1; Thu, 02 Apr 2020 10:54:43 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A090B800D53; Thu, 2 Apr 2020 14:54:41 +0000 (UTC) Received: from localhost (ovpn-115-222.ams2.redhat.com [10.36.115.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id F205B5C290; Thu, 2 Apr 2020 14:54:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585839286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EQd/tAWeF/YV2ZgjjIRKrDKai5RAA8QDSkAEaREc33E=; b=CbwUvLbrr8TALnshRJ5UuObmxD26SbktMBPX6IHJOyOqoL/Yrna0JJC8Q9QOqU0CnT2o2a L3NtJioXnDA8ar8TyZNOzY1yLyvNzZ4ko4vvBb84Ar/sbrNZb9bM7FvPQ5qQNrdMKpU6VX aTPQHCW1qOY67cWSPBGvAL0D8odDJuY= X-MC-Unique: dNKkYIcYP5CP9Dk26D4eZA-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PATCH for-5.0] aio-posix: fix test-aio /aio/event/wait with fdmon-io_uring Date: Thu, 2 Apr 2020 15:54:34 +0100 Message-Id: <20200402145434.99349-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , qemu-block@nongnu.org, Julia Suvorova , Stefan Hajnoczi , Cole Robinson , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" When a file descriptor becomes ready we must re-arm POLL_ADD. This is done by adding an sqe to the io_uring sq ring. The ->need_wait() function wasn't taking pending sqes into account and therefore io_uring_submit_and_wait() was not being called. Polling for cqes failed to detect fd readiness since we hadn't submitted the sqe to io_uring. This patch fixes the following tests/test-aio -p /aio/event/wait failure: ok 11 /aio/event/wait ** ERROR:tests/test-aio.c:374:test_flush_event_notifier: assertion failed: (= aio_poll(ctx, false)) Reported-by: Cole Robinson Fixes: 73fd282e7b6dd4e4ea1c3bbb3d302c8db51e4ccf ("aio-posix: add io_uring fd monitoring implementation") Signed-off-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Tested-by: Cole Robinson --- util/fdmon-io_uring.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/fdmon-io_uring.c b/util/fdmon-io_uring.c index 7e143ef515..b4d6109f20 100644 --- a/util/fdmon-io_uring.c +++ b/util/fdmon-io_uring.c @@ -295,7 +295,12 @@ static bool fdmon_io_uring_need_wait(AioContext *ctx) return true; } =20 - /* Do we need to submit new io_uring sqes? */ + /* Are there pending sqes to submit? */ + if (io_uring_sq_ready(&ctx->fdmon_io_uring)) { + return true; + } + + /* Do we need to process AioHandlers for io_uring changes? */ if (!QSLIST_EMPTY_RCU(&ctx->submit_list)) { return true; } --=20 2.25.1