From nobody Sat Sep 21 00:44:41 2024 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=1585914868; cv=none; d=zohomail.com; s=zohoarc; b=gbEiGVnv/FmpcGQNV4pFWcHirbn28XS8z2/xsLhZ0CYtxDyTcXCMr2T8oy7p0JA/q39dpOhANAzhZgnUt4fk6kKOkb6CbUsVwV3CJ83p4nhAQGP6c/j3qzy+6qr2sMpJY+e0I/jsEZYA23f8/s8bQNIFcBTVa7tKZHIGmNaRS2g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585914868; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eVgjL2U3XiNM2V2E3TmxtaKINmOxqSXhRnhGHxJw9Xk=; b=j4PRio0tlkWqQgInPKPo+Un4iU3XZ01b/jIRXq0aL3MW4Z4B5R3JMRG5AfG/Yops4Rh+dNkcsE4sMz5UkUEGK8K6R+YjjCFfmIKugaeQk/yPMv/9WXc3hJK5+iBYXroodqO2Tvspau2VcGFLmTJVCK6HFcaEP9kHU6dBuT8oro0= 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 1585914868336223.7077606393575; Fri, 3 Apr 2020 04:54:28 -0700 (PDT) Received: from localhost ([::1]:54114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKKu2-0002CM-Us for importer@patchew.org; Fri, 03 Apr 2020 07:54:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49246) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKKs0-0006y1-MZ for qemu-devel@nongnu.org; Fri, 03 Apr 2020 07:52:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jKKrz-0002qS-BW for qemu-devel@nongnu.org; Fri, 03 Apr 2020 07:52:20 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:30079 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 1jKKrz-0002q7-7y for qemu-devel@nongnu.org; Fri, 03 Apr 2020 07:52:19 -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-457--K8wIaNQNQWNb2fT6hXOoA-1; Fri, 03 Apr 2020 07:52:17 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EA3698018A1; Fri, 3 Apr 2020 11:52:15 +0000 (UTC) Received: from localhost (ovpn-114-214.ams2.redhat.com [10.36.114.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id 812C2A63CE; Fri, 3 Apr 2020 11:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585914738; 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: in-reply-to:in-reply-to:references:references; bh=eVgjL2U3XiNM2V2E3TmxtaKINmOxqSXhRnhGHxJw9Xk=; b=LnVSyH8qYWhRLMYuUBzKZcMCY10nudnJRK2oos7jURwsLel3ab+ZuceTIz3lUhw9ICBt6Z XHJ8r+icAEC62xhnwNfOEPOvH7L1VhdiJthtFQqAODcjMSGcO4m5KrRVjY1JxMX6dUsZGl BUCMo00/DqneXhGYd6W4xiW/nhO6pKQ= X-MC-Unique: -K8wIaNQNQWNb2fT6hXOoA-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL for-5.0 1/1] aio-posix: fix test-aio /aio/event/wait with fdmon-io_uring Date: Fri, 3 Apr 2020 12:52:09 +0100 Message-Id: <20200403115209.145810-2-stefanha@redhat.com> In-Reply-To: <20200403115209.145810-1-stefanha@redhat.com> References: <20200403115209.145810-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: Kevin Wolf , Fam Zheng , qemu-block@nongnu.org, Peter Maydell , Max Reitz , Stefan Hajnoczi , Cole Robinson , Stefano Garzarella 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 Reviewed-by: Stefano Garzarella Tested-by: Cole Robinson Signed-off-by: Stefan Hajnoczi Message-id: 20200402145434.99349-1-stefanha@redhat.com Fixes: 73fd282e7b6dd4e4ea1c3bbb3d302c8db51e4ccf ("aio-posix: add io_uring fd monitoring implementation") Signed-off-by: Stefan Hajnoczi --- 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