Skip to content
Snippets Groups Projects
  1. Sep 29, 2021
    • Nir Soffer's avatar
      qemu-nbd: Change default cache mode to writeback · 09615257
      Nir Soffer authored
      Both qemu and qemu-img use writeback cache mode by default, which is
      already documented in qemu(1). qemu-nbd uses writethrough cache mode by
      default, and the default cache mode is not documented.
      
      According to the qemu-nbd(8):
      
         --cache=CACHE
                The  cache  mode  to be used with the file.  See the
                documentation of the emulator's -drive cache=... option for
                allowed values.
      
      qemu(1) says:
      
          The default mode is cache=writeback.
      
      So users have no reason to assume that qemu-nbd is using writethough
      cache mode. The only hint is the painfully slow writing when using the
      defaults.
      
      Looking in git history, it seems that qemu used writethrough in the past
      to support broken guests that did not flush data properly, or could not
      flush due to limitations in qemu. But qemu-nbd clients can use
      NBD_CMD_FLUSH to flush data, so using writethrough does not help anyone.
      
      Change the default cache mode to writback, and document the default and
      available values properly in the online help and manual.
      
      With this change converting image via qemu-nbd is 3.5 times faster.
      
          $ qemu-img create dst.img 50g
          $ qemu-nbd -t -f raw -k /tmp/nbd.sock dst.img
      
      Before this change:
      
          $ hyperfine -r3 "./qemu-img convert -p -f raw -O raw -T none -W fedora34.img nbd+unix:///?socket=/tmp/nbd.sock"
          Benchmark #1: ./qemu-img convert -p -f raw -O raw -T none -W fedora34.img nbd+unix:///?socket=/tmp/nbd.sock
            Time (mean ± σ):     83.639 s ±  5.970 s    [User: 2.733 s, System: 6.112 s]
            Range (min … max):   76.749 s … 87.245 s    3 runs
      
      After this change:
      
          $ hyperfine -r3 "./qemu-img convert -p -f raw -O raw -T none -W fedora34.img nbd+unix:///?socket=/tmp/nbd.sock"
          Benchmark #1: ./qemu-img convert -p -f raw -O raw -T none -W fedora34.img nbd+unix:///?socket=/tmp/nbd.sock
            Time (mean ± σ):     23.522 s ±  0.433 s    [User: 2.083 s, System: 5.475 s]
            Range (min … max):   23.234 s … 24.019 s    3 runs
      
      Users can avoid the issue by using --cache=writeback[1] but the defaults
      should give good performance for the common use case.
      
      [1] https://bugzilla.redhat.com/1990656
      
      
      
      Signed-off-by: default avatarNir Soffer <nsoffer@redhat.com>
      Message-Id: <20210813205519.50518-1-nsoffer@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      CC: qemu-stable@nongnu.org
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      09615257
  2. Sep 28, 2021
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/jsnow-gitlab/tags/python-pull-request' into staging · 6b54a31b
      Peter Maydell authored
      
      Python Pull request
      
      # gpg: Signature made Mon 27 Sep 2021 20:24:39 BST
      # gpg:                using RSA key F9B7ABDBBCACDF95BE76CBD07DEF8106AAFC390E
      # gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>" [full]
      # Primary key fingerprint: FAEB 9711 A12C F475 812F  18F2 88A9 064D 1835 61EB
      #      Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76  CBD0 7DEF 8106 AAFC 390E
      
      * remotes/jsnow-gitlab/tags/python-pull-request: (32 commits)
        python/aqmp-tui: Add syntax highlighting
        python: add optional pygments dependency
        python: Add entry point for aqmp-tui
        python/aqmp-tui: Add AQMP TUI
        python: Add dependencies for AQMP TUI
        python/aqmp: Add Coverage.py support
        python/aqmp: add LineProtocol tests
        python/aqmp: add AsyncProtocol unit tests
        python: bump avocado to v90.0
        python/aqmp: add scary message
        python/aqmp: add asyncio_run compatibility wrapper
        python/aqmp: add _raw() execution interface
        python/aqmp: add execute() interfaces
        python/aqmp: Add message routing to QMP protocol
        python/pylint: disable no-member check
        python/aqmp: add QMP protocol support
        python/pylint: disable too-many-function-args
        python/aqmp: add QMP event support
        python/aqmp: add well-known QMP object models
        python/aqmp: add QMP Message format
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      6b54a31b
  3. Sep 27, 2021
Loading