qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Wolfgang Richter <wolf@cs.cmu.edu>,
	qemu-devel <qemu-devel@nongnu.org>,
	stefanha <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [RFC] block-trace Low Level Command Supporting Disk Introspection
Date: Wed, 15 May 2013 10:53:21 +0200	[thread overview]
Message-ID: <20130515085321.GB2858@dhcp-200-207.str.redhat.com> (raw)
In-Reply-To: <5193465C.1040006@redhat.com>

Am 15.05.2013 um 10:25 hat Paolo Bonzini geschrieben:
> Il 15/05/2013 09:59, Kevin Wolf ha scritto:
> >>> Do you mean you'd model the 'active' mode after 'block-backup,' or actually
> >>> call functions provided by 'block-backup'?
> >>
> >> No, I'll just reuse the same hooks within block/mirror.c (almost... it
> >> looks like I need after_write too, not just before_write :( that's a
> >> pity).
> > 
> > Makes me wonder if using a real BlockDriver for the filter from the
> > beginning wouldn't be better than accumulating more and more hooks and
> > having to find ways to pass data from 'before' to 'after' hooks...
> 
> We don't need a way to pass data from before to after hooks, a simple
> scan of a linked list will do.

So in this case the linked list is the way.

> >> Basically:
> >>
> >> 1) before the write, if there is space in the job's buffers, allocate a
> >> MirrorOp and a data buffer for the write.  Also record whether the block
> >> was dirty before;
> >>
> >> 2) after the write, do nothing if there was no room to allocate the data
> >> buffer.  Else clear the block from the dirty bitmap.  If the block was
> >> dirty, read the whole cluster from the source as in passive mirroring.
> >> If it wasn't, copy the data from guest memory to the preallocated buffer
> >> and write it to the destination;
> > 
> > Does the "if there was no room" part mean that the mirror is active only
> > sometimes?
> 
> Yes, otherwise the guest can allocate arbitrary amounts of memory in the
> host just by starting a few very large I/O operations.

I think I would rather throttle I/O in this case, i.e. requests wait
until they can get the space. At least for a synchronous mirror we
have to do something like this.

> > And why even bother with a dirty bitmap for an active mirror? The
> > background job that sequentially processes the whole image only needs a
> > counter, no bitmap.
> 
> That's not enough for the case when the host crashes and you have to
> restart the mirroring or complete it offline.

You're thinking of a persistent bitmap here? Makes sense then, I didn't
think about that.

Kevin

  reply	other threads:[~2013-05-15  8:53 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-13 21:21 [Qemu-devel] [RFC] block-trace Low Level Command Supporting Disk Introspection Wolfgang Richter
2013-05-14  8:40 ` Stefan Hajnoczi
2013-05-14 15:42   ` Wolfgang Richter
2013-05-14  8:50 ` Kevin Wolf
2013-05-14 10:04   ` Paolo Bonzini
2013-05-14 15:48     ` Wolfgang Richter
2013-05-14 16:45       ` Paolo Bonzini
2013-05-14 19:30         ` Wolfgang Richter
2013-05-15  7:59         ` Kevin Wolf
2013-05-15  8:25           ` Paolo Bonzini
2013-05-15  8:53             ` Kevin Wolf [this message]
2013-05-15  9:16               ` Paolo Bonzini
2013-05-15  9:46                 ` Kevin Wolf
2013-05-15 11:54                   ` Paolo Bonzini
2013-05-22 15:46                     ` Wolfgang Richter
2013-05-14 15:45   ` Wolfgang Richter
2013-05-16 13:44 ` Richard W.M. Jones
2013-05-22 15:51   ` Wolfgang Richter
2013-05-22 16:11     ` Paolo Bonzini
2013-05-22 16:29       ` Wolfgang Richter
2013-05-22 16:42     ` Richard W.M. Jones
2013-05-22 18:32       ` Wolfgang Richter
2013-05-22 19:26         ` Richard W.M. Jones
2013-05-22 19:38           ` Wolfgang Richter
2013-05-22 20:47             ` Richard W.M. Jones
2013-05-22 21:46               ` Paolo Bonzini
2013-05-23  7:50                 ` Stefan Hajnoczi

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=20130515085321.GB2858@dhcp-200-207.str.redhat.com \
    --to=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wolf@cs.cmu.edu \
    /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).