qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: armbru@redhat.com, mreitz@redhat.com, kwolf@redhat.com,
	jsnow@redhat.com, famz@redhat.com, vsementsov@virtuozzo.com,
	den@openvz.org
Subject: [Qemu-devel] [PATCH 2/7] dirty-bitmaps: fix comment about dirty_bitmap_mutex
Date: Mon, 26 Mar 2018 14:20:51 +0300	[thread overview]
Message-ID: <20180326112056.8420-3-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20180326112056.8420-1-vsementsov@virtuozzo.com>

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 <vsementsov@virtuozzo.com>
---
 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;
 
-    /* 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_mutex.
+     *
+     * Any access to underlying HBitmap requires dirty_bitmap_mutex.
+     */
     QemuMutex dirty_bitmap_mutex;
     QLIST_HEAD(, BdrvDirtyBitmap) dirty_bitmaps;
 
-- 
2.11.1

  parent reply	other threads:[~2018-03-26 11:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 11:20 [Qemu-devel] [PATCH 0/7] Dirty bitmaps fixing and refactoring Vladimir Sementsov-Ogievskiy
2018-03-26 11:20 ` [Qemu-devel] [PATCH 1/7] block/dirty-bitmap: add lock to bdrv_enable/disable_dirty_bitmap Vladimir Sementsov-Ogievskiy
2018-03-26 11:20 ` Vladimir Sementsov-Ogievskiy [this message]
2018-03-26 11:20 ` [Qemu-devel] [PATCH 3/7] dirty-bitmap: remove missed bdrv_dirty_bitmap_get_autoload header Vladimir Sementsov-Ogievskiy
2018-03-26 11:20 ` [Qemu-devel] [PATCH 4/7] dirty-bitmap: separate unused meta-bitmap related functions Vladimir Sementsov-Ogievskiy
2018-03-26 11:20 ` [Qemu-devel] [PATCH 5/7] blockdev: refactor block-dirty-bitmap-clear transaction Vladimir Sementsov-Ogievskiy
2018-03-26 11:44   ` Paolo Bonzini
2018-03-26 11:48     ` Vladimir Sementsov-Ogievskiy
2018-03-26 11:53       ` Vladimir Sementsov-Ogievskiy
2018-03-26 11:20 ` [Qemu-devel] [PATCH 6/7] block/dirty-bitmap: bdrv_clear_dirty_bitmap: drop unused parameter Vladimir Sementsov-Ogievskiy
2018-03-26 11:20 ` [Qemu-devel] [PATCH 7/7] blockdev: unify block-dirty-bitmap-clear command and transaction action Vladimir Sementsov-Ogievskiy
2018-03-26 11:44 ` [Qemu-devel] [PATCH 0/7] Dirty bitmaps fixing and refactoring Paolo Bonzini
2018-03-26 11:53 ` [Qemu-devel] [PATCH 5.5/7] dirty-bitmap: drop unused bdrv_undo_clear_dirty_bitmap Vladimir Sementsov-Ogievskiy
2018-03-26 13:21   ` no-reply
2018-03-26 14:21   ` no-reply
2018-03-26 15:56   ` no-reply
2018-03-26 17:04   ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180326112056.8420-3-vsementsov@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=famz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).