From nobody Sat Feb 7 08:58:29 2026 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522063636814114.01059469841482; Mon, 26 Mar 2018 04:27:16 -0700 (PDT) Received: from localhost ([::1]:55962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0QHU-0001Ed-3v for importer@patchew.org; Mon, 26 Mar 2018 07:27:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0QBT-00045W-MY for qemu-devel@nongnu.org; Mon, 26 Mar 2018 07:21:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0QBQ-0007My-Gy for qemu-devel@nongnu.org; Mon, 26 Mar 2018 07:21:03 -0400 Received: from relay.sw.ru ([185.231.240.75]:53050) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f0QBQ-0007Jl-7y; Mon, 26 Mar 2018 07:21:00 -0400 Received: from msk-vpn.virtuozzo.com ([195.214.232.6] helo=kvm.sw.ru) by relay.sw.ru with esmtp (Exim 4.90_1) (envelope-from ) id 1f0QBN-0002xv-HN; Mon, 26 Mar 2018 14:20:57 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Mon, 26 Mar 2018 14:20:51 +0300 Message-Id: <20180326112056.8420-3-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20180326112056.8420-1-vsementsov@virtuozzo.com> References: <20180326112056.8420-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH 2/7] dirty-bitmaps: fix comment about dirty_bitmap_mutex 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: kwolf@redhat.com, vsementsov@virtuozzo.com, famz@redhat.com, armbru@redhat.com, mreitz@redhat.com, den@openvz.org, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Clarify first two cases and fix Modify -> Any access in third case. Also, drop 'only' from third case, as it a bit confuses, when thinking about case where we modify BdrvDirtyBitmap and access HBitmap. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index 27e17addba..e5af7820ff 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -701,10 +701,14 @@ struct BlockDriverState { uint64_t write_threshold_offset; NotifierWithReturn write_threshold_notifier; =20 - /* Writing to the list requires the BQL _and_ the dirty_bitmap_mutex. - * Reading from the list can be done with either the BQL or the - * dirty_bitmap_mutex. Modifying a bitmap only requires - * dirty_bitmap_mutex. */ + /* Writing to the list (i.e. to any field of BdrvDirtyBitmap or to the + * list-head) requires both the BQL _and_ the dirty_bitmap_mutex. + * + * Reading from the list (from any field of BdrvDirtyBitmap or from the + * list-head) can be done with either the BQL or the dirty_bitmap_mute= x. + * + * Any access to underlying HBitmap requires dirty_bitmap_mutex. + */ QemuMutex dirty_bitmap_mutex; QLIST_HEAD(, BdrvDirtyBitmap) dirty_bitmaps; =20 --=20 2.11.1