qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] c13be5: async: rename event_notifier_dummy_cb


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] c13be5: async: rename event_notifier_dummy_cb/poll()
Date: Fri, 21 Aug 2020 12:15:36 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: c13be5a1bfcd6cafdf20072c75eaf3e5af35f2e6
      
https://github.com/qemu/qemu/commit/c13be5a1bfcd6cafdf20072c75eaf3e5af35f2e6
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2020-08-13 (Thu, 13 Aug 2020)

  Changed paths:
    M util/async.c

  Log Message:
  -----------
  async: rename event_notifier_dummy_cb/poll()

The event_notifier_*() prefix can be confused with the EventNotifier
APIs that are also called event_notifier_*().

Rename the functions to aio_context_notifier_*() to make it clear that
they relate to the AioContext::notifier field.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20200806131802.569478-2-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: 601829f88e0eff8f54fa08b7a69b0774a9c259c8
      
https://github.com/qemu/qemu/commit/601829f88e0eff8f54fa08b7a69b0774a9c259c8
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2020-08-13 (Thu, 13 Aug 2020)

  Changed paths:
    M util/async.c

  Log Message:
  -----------
  async: always set ctx->notified in aio_notify()

aio_notify() does not set ctx->notified when called with
ctx->aio_notify_me disabled. Therefore aio_notify_me needs to be enabled
during polling.

This is suboptimal since expensive event_notifier_set(&ctx->notifier)
and event_notifier_test_and_clear(&ctx->notifier) calls are required
when ctx->aio_notify_me is enabled.

Change aio_notify() so that aio->notified is always set, regardless of
ctx->aio_notify_me. This will make polling cheaper since
ctx->aio_notify_me can remain disabled. Move the
event_notifier_test_and_clear() to the fd handler function (which is now
no longer an empty function so "dummy" has been dropped from its name).

The next patch takes advantage of this by optimizing polling in
util/aio-posix.c.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20200806131802.569478-3-stefanha@redhat.com

[Paolo Bonzini pointed out that the smp_wmb() in aio_notify_accept()
should be smp_wb() but the comment should be smp_wmb() instead of
smp_wb(). Fixed.
--Stefan]

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: 44277bf914471962c9e88e09c859aae65ae109c4
      
https://github.com/qemu/qemu/commit/44277bf914471962c9e88e09c859aae65ae109c4
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2020-08-13 (Thu, 13 Aug 2020)

  Changed paths:
    M util/aio-posix.c

  Log Message:
  -----------
  aio-posix: keep aio_notify_me disabled during polling

Polling only monitors the ctx->notified field and does not need the
ctx->notifier EventNotifier to be signalled. Keep ctx->aio_notify_me
disabled while polling to avoid unnecessary EventNotifier syscalls.

This optimization improves virtio-blk 4KB random read performance by
18%. The following results are with an IOThread and the null-co block
driver:

Test         IOPS   Error
Before  244518.62 ± 1.20%
After   290706.11 ± 0.44%

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20200806131802.569478-4-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: f86d9a093dada588889bde5582c7ec320487c4b8
      
https://github.com/qemu/qemu/commit/f86d9a093dada588889bde5582c7ec320487c4b8
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-08-21 (Fri, 21 Aug 2020)

  Changed paths:
    M util/aio-posix.c
    M util/async.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into 
staging

Pull request

# gpg: Signature made Mon 17 Aug 2020 15:34:34 BST
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  aio-posix: keep aio_notify_me disabled during polling
  async: always set ctx->notified in aio_notify()
  async: rename event_notifier_dummy_cb/poll()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/d6f83a72a7db...f86d9a093dad



reply via email to

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