qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] e2186a: tests: allow filtering crypto cipher


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] e2186a: tests: allow filtering crypto cipher benchmark tests
Date: Tue, 29 Oct 2019 09:26:01 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: e2186a3606bf80a7c1537690626aecd835a7c272
      
https://github.com/qemu/qemu/commit/e2186a3606bf80a7c1537690626aecd835a7c272
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-10-28 (Mon, 28 Oct 2019)

  Changed paths:
    M tests/benchmark-crypto-cipher.c

  Log Message:
  -----------
  tests: allow filtering crypto cipher benchmark tests

Add support for specifying a cipher mode and chunk size as argv to
filter which combinations are benchmarked. For example to only
benchmark XTS mode with 512 byte chunks:

  ./tests/benchmark-crypto-cipher xts 512

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Stefano Garzarella <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>


  Commit: b4296d7f88f3427c366af26b4fbd6765db88f846
      
https://github.com/qemu/qemu/commit/b4296d7f88f3427c366af26b4fbd6765db88f846
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-10-28 (Mon, 28 Oct 2019)

  Changed paths:
    M tests/benchmark-crypto-cipher.c
    M tests/benchmark-crypto-hash.c

  Log Message:
  -----------
  tests: benchmark crypto with fixed data size, not time period

Currently the crypto benchmarks are processing data in varying chunk
sizes, over a fixed time period. This turns out to be a terrible idea
because with small chunk sizes the overhead of checking the elapsed
time on each loop iteration masks the true performance.

Benchmarking over a fixed data size avoids the loop running any system
calls which can interfere with the performance measurements.

Before this change

Enc chunk 512 bytes 2283.47 MB/sec Dec chunk 512 bytes 2236.23 MB/sec OK
Enc chunk 4096 bytes 2744.97 MB/sec Dec chunk 4096 bytes 2614.71 MB/sec OK
Enc chunk 16384 bytes 2777.53 MB/sec Dec chunk 16384 bytes 2678.44 MB/sec OK
Enc chunk 65536 bytes 2809.34 MB/sec Dec chunk 65536 bytes 2699.47 MB/sec OK

After this change

Enc chunk 512 bytes 2058.22 MB/sec Dec chunk 512 bytes 2030.11 MB/sec OK
Enc chunk 4096 bytes 2699.27 MB/sec Dec chunk 4096 bytes 2573.78 MB/sec OK
Enc chunk 16384 bytes 2748.52 MB/sec Dec chunk 16384 bytes 2653.76 MB/sec OK
Enc chunk 65536 bytes 2814.08 MB/sec Dec chunk 65536 bytes 2712.74 MB/sec OK

The actual crypto performance hasn't changed, which shows how
significant the mis-measurement has been for small data sizes.

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Stefano Garzarella <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>


  Commit: e0576942e005de0f9226913cb0750cf445a33565
      
https://github.com/qemu/qemu/commit/e0576942e005de0f9226913cb0750cf445a33565
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-10-28 (Mon, 28 Oct 2019)

  Changed paths:
    M configure
    M crypto/Makefile.objs
    M crypto/cipher-gcrypt.c
    M tests/Makefile.include

  Log Message:
  -----------
  crypto: add support for gcrypt's native XTS impl

Libgcrypt 1.8.0 added support for the XTS mode. Use this because long
term we wish to delete QEMU's XTS impl to avoid carrying private crypto
algorithm impls.

As an added benefit, using this improves performance from 531 MB/sec to
670 MB/sec, since we are avoiding several layers of function call
indirection.

This is even more noticable with the gcrypt builds in Fedora or RHEL-8
which have a non-upstream patch for FIPS mode which does mutex locking.
This is catastrophic for encryption performance with small block sizes,
meaning this patch improves encryption from 240 MB/sec to 670 MB/sec.

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Stefano Garzarella <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>


  Commit: dc2207af2de162005f7e9e534850d07232290cee
      
https://github.com/qemu/qemu/commit/dc2207af2de162005f7e9e534850d07232290cee
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-10-28 (Mon, 28 Oct 2019)

  Changed paths:
    M configure
    M crypto/cipher-nettle.c

  Log Message:
  -----------
  crypto: add support for nettle's native XTS impl

Nettle 3.5.0 will add support for the XTS mode. Use this because long
term we wish to delete QEMU's XTS impl to avoid carrying private crypto
algorithm impls.

Unfortunately this degrades nettle performance from 612 MB/s to 568 MB/s
as nettle's XTS impl isn't so well optimized yet.

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Stefano Garzarella <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>


  Commit: 4599cb953c9744bb7dc3513d688f7f0100ee35e2
      
https://github.com/qemu/qemu/commit/4599cb953c9744bb7dc3513d688f7f0100ee35e2
  Author: Peter Maydell <address@hidden>
  Date:   2019-10-29 (Tue, 29 Oct 2019)

  Changed paths:
    M configure
    M crypto/Makefile.objs
    M crypto/cipher-gcrypt.c
    M crypto/cipher-nettle.c
    M tests/Makefile.include
    M tests/benchmark-crypto-cipher.c
    M tests/benchmark-crypto-hash.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/berrange/tags/crypto-luks-pull-request' 
into staging

crypto: improve performance of ciphers in XTS mode

Currently QEMU uses its own XTS cipher mode, however, this has
relatively poor performance.

Gcrypt now includes its own XTS cipher which is at least x2 faster than
what we get with QEMU's on Fedora/RHEL hosts. With gcrypt git master, a
further x5-6 speed up is seen.

This is essential for QEMU's LUKS performance to be viable.

# gpg: Signature made Mon 28 Oct 2019 15:48:38 GMT
# gpg:                using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <address@hidden>" [full]
# gpg:                 aka "Daniel P. Berrange <address@hidden>" [full]
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF

* remotes/berrange/tags/crypto-luks-pull-request:
  crypto: add support for nettle's native XTS impl
  crypto: add support for gcrypt's native XTS impl
  tests: benchmark crypto with fixed data size, not time period
  tests: allow filtering crypto cipher benchmark tests

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/8c68ff250ac3...4599cb953c97



reply via email to

[Prev in Thread] Current Thread [Next in Thread]