From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47969C41535 for ; Tue, 19 Dec 2023 13:04:07 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.656779.1025211 (Exim 4.92) (envelope-from ) id 1rFZl1-0007Is-R5; Tue, 19 Dec 2023 13:03:35 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 656779.1025211; Tue, 19 Dec 2023 13:03:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFZl1-0007Il-Nb; Tue, 19 Dec 2023 13:03:35 +0000 Received: by outflank-mailman (input) for mailman id 656779; Tue, 19 Dec 2023 13:03:33 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFZkz-0007If-LP for xen-devel@lists.xenproject.org; Tue, 19 Dec 2023 13:03:33 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 01c668e1-9e6f-11ee-9b0f-b553b5be7939; Tue, 19 Dec 2023 14:03:31 +0100 (CET) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-593-xVlPGfygOLSN3BRIuhYcfg-1; Tue, 19 Dec 2023 08:03:27 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EE52F1C0513E; Tue, 19 Dec 2023 13:03:26 +0000 (UTC) Received: from redhat.com (unknown [10.39.194.175]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3EF6E2026D66; Tue, 19 Dec 2023 13:03:22 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 01c668e1-9e6f-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702991010; 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: in-reply-to:in-reply-to:references:references; bh=4gjbsB35Qsptzv4ZyuMpQVHa+Sm/T5dLDnMD7DOxn/Q=; b=QPQCSsiZmhvzLzhjqCAopx5ZbKpP+V4hpApJ88m7jpp6U7j/IGwYasgUaJg8SyBQIo6kZ3 5zHKOh0b4CYcPuFwu1LO3iuRTvAbzdggV1S6lotNiVJDe6RGxvjU+T506v2FDHfbD6AvCA zfcSC9knDJBHl2EqtQKlqAmu9PD6iK0= X-MC-Unique: xVlPGfygOLSN3BRIuhYcfg-1 Date: Tue, 19 Dec 2023 14:03:21 +0100 From: Kevin Wolf To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= , Vladimir Sementsov-Ogievskiy , Cleber Rosa , Xie Changlong , Paul Durrant , Ari Sundholm , Jason Wang , Eric Blake , John Snow , Eduardo Habkost , Wen Congyang , Alberto Garcia , Anthony Perard , "Michael S. Tsirkin" , Stefano Stabellini , qemu-block@nongnu.org, Juan Quintela , Paolo Bonzini , Coiby Xu , Fabiano Rosas , Hanna Reitz , Zhang Chen , Daniel =?iso-8859-1?Q?P=2E_Berrang=E9?= , Pavel Dovgalyuk , Peter Xu , Emanuele Giuseppe Esposito , Fam Zheng , Leonardo Bras , David Hildenbrand , Li Zhijian , xen-devel@lists.xenproject.org Subject: Re: [PATCH v2 00/14] aio: remove AioContext lock Message-ID: References: <20231205182011.1976568-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231205182011.1976568-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Am 05.12.2023 um 19:19 hat Stefan Hajnoczi geschrieben: > v2: > - Add Patch 2 "scsi: assert that callbacks run in the correct AioContext" [Kevin] > - Add Patch 7 "block: remove bdrv_co_lock()" [Eric and Kevin] > - Remove stray goto label in Patch 8 [Kevin] > - Fix "eeked" -> "eked" typo in Patch 10 [Eric] > > This series removes the AioContext locking APIs from QEMU. > aio_context_acquire() and aio_context_release() are currently only needed to > support the locking discipline required by AIO_POLL_WHILE() (except for a stray > user that I converted in Patch 1). AIO_POLL_WHILE() doesn't really need the > AioContext lock anymore, so it's possible to remove the API. This is a nice > simplification because the AioContext locking rules were sometimes tricky or > underspecified, leading to many bugs of the years. > > This patch series removes these APIs across the codebase and cleans up the > documentation/comments that refers to them. > > Patch 1 is a AioContext lock user I forgot to convert in my earlier SCSI > conversion series. > > Patch 2 adds an assertion to the SCSI code to ensure that callbacks are invoked > in the correct AioContext. > > Patch 3 removes tests for the AioContext lock because they will no longer be > needed when the lock is gone. > > Patches 4-10 remove the AioContext lock. These can be reviewed by categorizing > the call sites into 1. places that take the lock because they call an API that > requires the lock (ultimately AIO_POLL_WHILE()) and 2. places that take the > lock to protect state. There should be no instances of case 2 left. If you see > one, you've found a bug in this patch series! > > Patches 11-14 remove comments. Thanks, applied to the block branch. Kevin