Drop 41xx slides dissecting an NBD command.
authorEric Blake <eblake@redhat.com>
Fri, 25 Oct 2019 18:08:46 +0000 (13:08 -0500)
committerEric Blake <eblake@redhat.com>
Fri, 25 Oct 2019 18:09:47 +0000 (13:09 -0500)
Instead, save the script backstory for offline, and leave the power of
nbdkit to the 6000 slides.  The 4000 slides now focus on just
improving qemu-img convert.

2019-kvm-forum/4110-baseline-1.html [deleted file]
2019-kvm-forum/4120-baseline-2.html [deleted file]
2019-kvm-forum/4130-baseline-3.html [deleted file]
2019-kvm-forum/4140-baseline-4.html [deleted file]
2019-kvm-forum/4150-baseline-5.html [deleted file]
2019-kvm-forum/4160-baseline-6.html [deleted file]
2019-kvm-forum/notes-04-fast-zero

diff --git a/2019-kvm-forum/4110-baseline-1.html b/2019-kvm-forum/4110-baseline-1.html
deleted file mode 100644 (file)
index 7f6f75f..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" href="style.css" type="text/css"/>
-<script src="code.js" type="text/javascript"></script>
-
-<h1>Dissecting that conversion</h1>
-
-<pre>
-<b>nbdkit -U -</b> --filter=log --filter=nozero --filter=blocksize \
-  --filter=delay --filter=stats --filter=noextents <b>memory 100m</b> \
-  logfile=>(sed -n '/Zero.*\.\./ s/.*\(fast=.\).*/\1/p' |sort|uniq -c) \
-  statsfile=/dev/stderr delay-write=20ms delay-zero=5ms maxdata=256k \
-  <b>--run 'qemu-img convert -n -f qcow2 -O raw src.qcow2 $nbd'</b> "$@"
-st=$?; sleep .2; exit $st
-</pre>
-
-</p>
diff --git a/2019-kvm-forum/4120-baseline-2.html b/2019-kvm-forum/4120-baseline-2.html
deleted file mode 100644 (file)
index 494644f..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" href="style.css" type="text/css"/>
-<script src="code.js" type="text/javascript"></script>
-
-<h1>Dissecting that conversion</h1>
-
-<pre>
-nbdkit -U - --filter=log --filter=nozero --filter=blocksize \
-  <b>--filter=delay</b> --filter=stats --filter=noextents memory 100m \
-  logfile=>(sed -n '/Zero.*\.\./ s/.*\(fast=.\).*/\1/p' |sort|uniq -c) \
-  statsfile=/dev/stderr <b>delay-write=20ms delay-zero=5ms</b> maxdata=256k \
-  --run 'qemu-img convert -n -f qcow2 -O raw src.qcow2 $nbd' "$@"
-st=$?; sleep .2; exit $st
-</pre>
-
-</p>
diff --git a/2019-kvm-forum/4130-baseline-3.html b/2019-kvm-forum/4130-baseline-3.html
deleted file mode 100644 (file)
index 2d752ca..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" href="style.css" type="text/css"/>
-<script src="code.js" type="text/javascript"></script>
-
-<h1>Dissecting that conversion</h1>
-
-<pre>
-nbdkit -U - --filter=log --filter=nozero <b>--filter=blocksize</b> \
-  --filter=delay --filter=stats --filter=noextents memory 100m \
-  logfile=>(sed -n '/Zero.*\.\./ s/.*\(fast=.\).*/\1/p' |sort|uniq -c) \
-  statsfile=/dev/stderr delay-write=20ms delay-zero=5ms <b>maxdata=256k</b> \
-  --run 'qemu-img convert -n -f qcow2 -O raw src.qcow2 $nbd' "$@"
-st=$?; sleep .2; exit $st
-</pre>
-
-</p>
diff --git a/2019-kvm-forum/4140-baseline-4.html b/2019-kvm-forum/4140-baseline-4.html
deleted file mode 100644 (file)
index ac9088c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" href="style.css" type="text/css"/>
-<script src="code.js" type="text/javascript"></script>
-
-<h1>Dissecting that conversion</h1>
-
-<pre>
-nbdkit -U - <b>--filter=log</b> --filter=nozero --filter=blocksize \
-  --filter=delay <b>--filter=stats</b> --filter=noextents memory 100m \
-  <b>logfile=>(sed -n '/Zero.*\.\./ s/.*\(fast=.\).*/\1/p' |sort|uniq -c)</b> \
-  <b>statsfile=/dev/stderr</b> delay-write=20ms delay-zero=5ms maxdata=256k \
-  --run 'qemu-img convert -n -f qcow2 -O raw src.qcow2 $nbd' "$@"
-<b>st=$?; sleep .2; exit $st</b>
-</pre>
-
-</p>
diff --git a/2019-kvm-forum/4150-baseline-5.html b/2019-kvm-forum/4150-baseline-5.html
deleted file mode 100644 (file)
index f2c48bb..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" href="style.css" type="text/css"/>
-<script src="code.js" type="text/javascript"></script>
-
-<h1>Dissecting that conversion</h1>
-
-<pre>
-nbdkit -U - --filter=log --filter=nozero --filter=blocksize \
-  --filter=delay --filter=stats <b>--filter=noextents</b> memory 100m \
-  logfile=>(sed -n '/Zero.*\.\./ s/.*\(fast=.\).*/\1/p' |sort|uniq -c) \
-  statsfile=/dev/stderr delay-write=20ms delay-zero=5ms maxdata=256k \
-  --run 'qemu-img convert -n -f qcow2 -O raw src.qcow2 $nbd' "$@"
-st=$?; sleep .2; exit $st
-</pre>
-
-</p>
diff --git a/2019-kvm-forum/4160-baseline-6.html b/2019-kvm-forum/4160-baseline-6.html
deleted file mode 100644 (file)
index af77195..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<link rel="stylesheet" href="style.css" type="text/css"/>
-<script src="code.js" type="text/javascript"></script>
-
-<h1>Dissecting that conversion</h1>
-
-<pre>
-nbdkit -U - --filter=log <b>--filter=nozero</b> --filter=blocksize \
-  --filter=delay --filter=stats --filter=noextents memory 100m \
-  logfile=>(sed -n '/Zero.*\.\./ s/.*\(fast=.\).*/\1/p' |sort|uniq -c) \
-  statsfile=/dev/stderr delay-write=20ms delay-zero=5ms maxdata=256k \
-  --run 'qemu-img convert -n -f qcow2 -O raw src.qcow2 $nbd' <b>"$@"</b>
-st=$?; sleep .2; exit $st
-</pre>
-
-</p>
index 59f2029..989e800 100644 (file)
@@ -11,45 +11,23 @@ As Rich mentioned, qemu-img convert is a great tool for copying guest
 images, with support for NBD on both source and destination.  However,
 most guest images are sparse, and we want to avoid naively reading
 lots of zeroes on the source then writing lots of zeroes on the
-destination.  Here's a case study of optimizing that, starting with a
-baseline of straightline copying, which matches qemu 3.0 behavior.
-XXX Is that correct version? what date?
-Let's convert a 100M image, which alternates between data and holes at
-each megabyte.
-
-* Heading: Dissecting that command
-- 41x0 - series of html pages to highlight aspects of the ./convert command
-  - nbkdit, plugin server, --run command
-  - delay filter
-  - blocksize filter
-  - stats, log filters
-  - noextents filter
-  - nozero filter
-
-Okay, I went a bit fast on that ./convert command.  Looking closer, it
-is using nbdkit as a server with the memory plugin as the data sink,
-tied to a single invocation of qemu-img convert as the source over a
-Unix socket.  There are lots of nbdkit filters: we want to slow down
-the operation so a small disk can still be useful in performance
-testing, and where the server defaults to a zero operation that is
-faster than writes.  We want to demonstrate the fact that a single
-write zero operation (with no explicit network payload) can often
-cover a larger swath of the file in one operation than writes (which
-have a maximum payload per operation), by forcing writes to split
-smaller than the 1M striping of the source image.  We want to collect
-statistics, both of the overall time spent, and which operations the
-client attempted, and include a sleep to avoid an output race.  For
-this case study, we disable BLOCK_STATUS with noextents (more on why
-later).  And finally we use the nozero filter as our knob for what the
-server advertises to the client, as well as how it responds to various
-zero-related requests.
+destination.  Here's a case study of our last three years in
+optimizing that, starting with a baseline of straightline copying,
+which matches qemu 2.7 behavior (Sep 2016).  Let's convert a 100M
+image, which alternates between data and holes at each megabyte.
+
+The ./convert command show here is rather long; if you're interested
+in its origins, my patch submission in Aug 2019 goes into more
+details.  But for now, just think of it as a fancy way to run
+'qemu-img convert' against a server where I can tweak server behavior
+to control which zeroing-related features are advertised or
+implemented.
 
 * Heading: Writing zeroes: much ado about nothing
 - 4200- .term
   - ./convert zeromode=plugin fastzeromode=none for server A
   - ./convert zeromode=emulate fastzeromode=none for server B
 
-XXX - verify versions/dates
 In qemu 2.8 (Dec 2016), we implemented the NBD extension of
 WRITE_ZEROES, with the initial goal of reducing network traffic (no
 need to send an explicit payload of all zero bytes over the network).
@@ -68,21 +46,22 @@ no real difference from the baseline.  But can we do better?
 Do we even have to worry whether WRITE_ZEROES will be fast or slow?
 If we know that the destination already contains all zeroes, we could
 entirely skip destination I/O for each hole in the source.  qemu 2.12
-added support for NBD_CMD_BLOCK_STATUS to quickly learn whether a
-portion of a disk is a hole.  But experiments with qemu-img convert
-showed that using BLOCK_STATUS as a way to avoid WRITE_ZEROES didn't
-really help, for a couple of reasons.  If writing zeroes is fast,
-checking the destination first is either a mere tradeoff in commands
-(BLOCK_STATUS replacing WRITE_ZEROES when the destination is already
-zero) or a pessimization (BLOCK_STATUS still has to be followed by
-WRITE_ZEROES).  And if writing zeroes is slow, we have a speedup holes
-when BLOCK_STATUS itself is fast on pre-existing destination holes,
-but we encountered situations such as tmpfs that has a linear rather
-than constant-time lseek(SEEK_HOLE) implementation, where we ended up
-with quadratic behavior all due to BLOCK_STATUS calls.  Thus, for now,
-qemu-img convert does not use BLOCK_STATUS, and as mentioned earlier,
-I used the noextents filter in my test case to ensure BLOCK_STATUS is
-not interfering with timing results.
+(Apr 2018) added support for NBD_CMD_BLOCK_STATUS to quickly learn
+whether a portion of a disk is a hole.  But experiments with qemu-img
+convert showed that using BLOCK_STATUS as a way to avoid WRITE_ZEROES
+didn't really help, for a couple of reasons.  If writing zeroes is
+fast, checking the destination first is either a mere tradeoff in
+commands (BLOCK_STATUS replacing WRITE_ZEROES when the destination is
+already zero) or a pessimization (BLOCK_STATUS still has to be
+followed by WRITE_ZEROES).  And if writing zeroes is slow, we have a
+speedup holes when BLOCK_STATUS itself is fast on pre-existing
+destination holes, but we encountered situations such as tmpfs that
+has a linear rather than constant-time lseek(SEEK_HOLE)
+implementation, where we ended up with quadratic behavior all due to
+BLOCK_STATUS calls.  Thus, for now, qemu-img convert does not use
+BLOCK_STATUS, and as mentioned earlier, I used the noextents filter in
+my test case to ensure BLOCK_STATUS is not interfering with timing
+results.
 
 * Heading: Pre-zeroing: a tale of two servers
 - 4400- .term