All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] Meeting notes on -blockdev, dynamic backend reconfiguration
Date: Wed, 7 Dec 2016 10:55:34 +0800	[thread overview]
Message-ID: <20161207025457.GB30227@lemon> (raw)
In-Reply-To: <87oa0q1t21.fsf@dusky.pond.sub.org>

On Mon, 12/05 13:03, Markus Armbruster wrote:
> == Basic dynamic reconfiguration operation ==
> 
> The basic operation is "replace child".
> 
> Beware of race conditions.  Consider:
> 
>           BB
>           |
>     mirror-filter
>           |
>          BDS
> 
> Add a throttle filter under BB while the mirror job is running.  First
> step, create the filter:
> 
>           BB    throttle-filter
>           |     /
>     mirror-filter
>           |
>          BDS
> 
> Second step, replace child of BB by the new filter:
> 
>           BB
>           |
>    throttle-filter
>           |
>     mirror-filter
>           |
>          BDS
> 
> But: if mirror-filter goes away between the two steps, the replace
> brings it right back!
> 
> To guard against such races, we need to specify both ends of the edge
> being replaced, i.e. parent, child name, actual child.  Then the replace
> step fails if the mirror-filter has gone away.  We can either fail the
> whole operation, or start over.
> 
> Alternatively, transactions, but that feels much more complex.
> 

Isn't it easy to make creating throttle-filter and replacing child happen in the
same critical section of BQL, without any coroutine yield?  If so I think there
is no race to worry about, mirror-filter should go away only after a QMP command.

Fam

  parent reply	other threads:[~2016-12-07  2:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05 12:03 [Qemu-devel] Meeting notes on -blockdev, dynamic backend reconfiguration Markus Armbruster
2016-12-06 11:03 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-12-07  2:55 ` Fam Zheng [this message]
2016-12-07  9:48   ` Kevin Wolf
2016-12-07 10:03     ` Fam Zheng
2016-12-08 12:46       ` Markus Armbruster
2016-12-08 13:47         ` Fam Zheng
2016-12-12 13:58           ` Markus Armbruster
2016-12-12 14:43             ` Fam Zheng
2016-12-12 18:23               ` Markus Armbruster
2016-12-13  6:51                 ` Fam Zheng

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=20161207025457.GB30227@lemon \
    --to=famz@redhat.com \
    --cc=armbru@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.