QEMU-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: John Snow <jsnow@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-block@nongnu.org
Cc: fam@euphon.net, kwolf@redhat.com, qemu-devel@nongnu.org,
	armbru@redhat.com, mreitz@redhat.com, den@openvz.org
Subject: Re: [Qemu-devel] [PATCH v2 3/3] block/qcow2: proper locking on bitmap add/remove paths
Date: Fri, 13 Sep 2019 18:26:31 -0400
Message-ID: <884049bb-dd47-fead-ae0c-49e8459bb5a5@redhat.com> (raw)
In-Reply-To: <20190911150054.90936-4-vsementsov@virtuozzo.com>



On 9/11/19 11:00 AM, Vladimir Sementsov-Ogievskiy wrote:
> qmp_block_dirty_bitmap_add and do_block_dirty_bitmap_remove do acquire
> aio context since 0a6c86d024c52b. But this is not enough: we also must
> lock qcow2 mutex when access in-image metadata. Especially it concerns
> freeing qcow2 clusters.
> 
> To achieve this, move qcow2_can_store_new_dirty_bitmap and
> qcow2_remove_persistent_dirty_bitmap to coroutine context.
> 
> Since we work in coroutines in correct aio context, we don't need
> context acquiring in blockdev.c anymore, drop it.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

It makes sense to me given the context, but I'll want Kevin or Max to
eye it over for locking correctness, admittedly.

Here's my good faith RB:

Reviewed-by: John Snow <jsnow@redhat.com>


(I'm not so sure about the aio_wait_kick. Why is that needed here? ...

oh, 4720cbeea1f42fd905fc69338fd42b191e58b412 explains why.
I suppose any synchronous caller of a co_ function needs to make sure
that the entry shim kicks on the way out. This seems very easy to get
wrong, doesn't it?)


      reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11 15:00 [Qemu-devel] [PATCH v2 0/3] " Vladimir Sementsov-Ogievskiy
2019-09-11 15:00 ` [Qemu-devel] [PATCH v2 1/3] block: move bdrv_can_store_new_dirty_bitmap to block/dirty-bitmap.c Vladimir Sementsov-Ogievskiy
2019-09-13 21:51   ` John Snow
2019-09-11 15:00 ` [Qemu-devel] [PATCH v2 2/3] block/dirty-bitmap: return int from bdrv_remove_persistent_dirty_bitmap Vladimir Sementsov-Ogievskiy
2019-09-13 22:01   ` John Snow
2019-09-16  8:22     ` Vladimir Sementsov-Ogievskiy
2019-09-11 15:00 ` [Qemu-devel] [PATCH v2 3/3] block/qcow2: proper locking on bitmap add/remove paths Vladimir Sementsov-Ogievskiy
2019-09-13 22:26   ` John Snow [this message]

Reply instructions:

You may reply publically 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=884049bb-dd47-fead-ae0c-49e8459bb5a5@redhat.com \
    --to=jsnow@redhat.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /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

QEMU-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git
	git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \
		qemu-devel@nongnu.org qemu-devel@archiver.kernel.org
	public-inbox-index qemu-devel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.nongnu.qemu-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox