qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.6 0/2] block/mirror: Fix mirroring with guest I/O load
@ 2016-04-19 22:59 Max Reitz
  2016-04-19 22:59 ` [Qemu-devel] [PATCH for-2.6 1/2] block/mirror: Revive dead yielding code Max Reitz
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Max Reitz @ 2016-04-19 22:59 UTC (permalink / raw)
  To: qemu-block; +Cc: qemu-devel, Max Reitz, Kevin Wolf, Jeff Cody, Fam Zheng

Bug report: https://bugs.launchpad.net/qemu/+bug/1570134

If you are doing a mirror operation (I just tested with block-commit on
the active layer, but I guess any mirroring will do) while the guest has
rather heavy I/O load (or light I/O also, you just need to be more
unlucky) will lead to the cache of mirror's bitmap iterator becoming
stale and not reflect all dirty bits which are set in the drive's dirty
bitmap.

Generally, this isn't bad because we just restart over once we are
through, and this will refresh the iterator's cache.

But it is bad for the code which tries to find a contiguous range of
dirty chunks. This code needs to clear the bits in the iterator, so it
invokes hbitmap_iter_next() for every contiguous dirty chunk found. But
then it has to make sure that this actually cleared that chunk's dirty
bit: And if the iterator's cache is stale, this may not be the case.
Then, we run into a failed assertion.

But detecting this discrepancy is easy and refreshing the iterator's
cache is too; and then, the assertion holds.

Besides this (patch 2), the code which is supposed to wait for
overlapping in-flight requests on the first chunk of a dirty range is
dead. I didn't produce any problems regarding that, but I'm sure it's
not good. Patch 1 fixes that.


Max Reitz (2):
  block/mirror: Revive dead yielding code
  block/mirror: Refresh stale bitmap iterator cache

 block/mirror.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

-- 
2.8.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-04-20 12:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-19 22:59 [Qemu-devel] [PATCH for-2.6 0/2] block/mirror: Fix mirroring with guest I/O load Max Reitz
2016-04-19 22:59 ` [Qemu-devel] [PATCH for-2.6 1/2] block/mirror: Revive dead yielding code Max Reitz
2016-04-20  5:47   ` Fam Zheng
2016-04-20 12:15   ` Kevin Wolf
2016-04-19 22:59 ` [Qemu-devel] [PATCH for-2.6 2/2] block/mirror: Refresh stale bitmap iterator cache Max Reitz
2016-04-20  8:19   ` Fam Zheng
2016-04-20 12:13   ` Kevin Wolf
2016-04-20 12:51     ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2016-04-20 12:51 ` [Qemu-devel] [PATCH for-2.6 0/2] block/mirror: Fix mirroring with guest I/O load Kevin Wolf

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).