From nobody Wed Nov 5 07:34:30 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534171477637485.76458467598763; Mon, 13 Aug 2018 07:44:37 -0700 (PDT) Received: from localhost ([::1]:39876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpE58-0006O3-P5 for importer@patchew.org; Mon, 13 Aug 2018 10:44:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpE48-0005yb-Sj for qemu-devel@nongnu.org; Mon, 13 Aug 2018 10:43:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpE48-0007mk-3g for qemu-devel@nongnu.org; Mon, 13 Aug 2018 10:43:28 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33518 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fpE43-0007km-Kx; Mon, 13 Aug 2018 10:43:23 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CC66F40241C5; Mon, 13 Aug 2018 14:43:22 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-29.ams2.redhat.com [10.36.112.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF1602026D66; Mon, 13 Aug 2018 14:43:21 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 13 Aug 2018 16:43:19 +0200 Message-Id: <20180813144320.12382-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 13 Aug 2018 14:43:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 13 Aug 2018 14:43:22 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pbonzini@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH] nvme: simplify code around completion X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: famz@redhat.com, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" nvme_poll_queues is already protected by q->lock, and AIO callbacks are invoked outside the AioContext lock. So remove the acquire/release pair in nvme_handle_event. Remove unnecessary variable in in nvme_poll_cb. Signed-off-by: Paolo Bonzini --- block/nvme.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 6f71122bf5..df2e16fabe 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -489,10 +489,8 @@ static void nvme_handle_event(EventNotifier *n) BDRVNVMeState *s =3D container_of(n, BDRVNVMeState, irq_notifier); =20 trace_nvme_handle_event(s); - aio_context_acquire(s->aio_context); event_notifier_test_and_clear(n); nvme_poll_queues(s); - aio_context_release(s->aio_context); } =20 static bool nvme_add_io_queue(BlockDriverState *bs, Error **errp) @@ -539,11 +537,9 @@ static bool nvme_poll_cb(void *opaque) { EventNotifier *e =3D opaque; BDRVNVMeState *s =3D container_of(e, BDRVNVMeState, irq_notifier); - bool progress =3D false; =20 trace_nvme_poll_cb(s); - progress =3D nvme_poll_queues(s); - return progress; + return nvme_poll_queues(s); } =20 static int nvme_init(BlockDriverState *bs, const char *device, int namespa= ce, --=20 2.17.1