qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 044540: iothread: generalize iothread_set_par


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 044540: iothread: generalize iothread_set_param/iothread_g...
Date: Wed, 21 Jul 2021 06:14:00 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 0445409d7497bededa1047f0d8298b0d4bb3b1a3
      
https://github.com/qemu/qemu/commit/0445409d7497bededa1047f0d8298b0d4bb3b1a3
  Author: Stefano Garzarella <sgarzare@redhat.com>
  Date:   2021-07-21 (Wed, 21 Jul 2021)

  Changed paths:
    M iothread.c

  Log Message:
  -----------
  iothread: generalize iothread_set_param/iothread_get_param

Changes in preparation for next patches where we add a new
parameter not related to the poll mechanism.

Let's add two new generic functions (iothread_set_param and
iothread_get_param) that we use to set and get IOThread
parameters.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-id: 20210721094211.69853-2-sgarzare@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: 1793ad0247cad35db1ebbc04fbea0446c30a27ca
      
https://github.com/qemu/qemu/commit/1793ad0247cad35db1ebbc04fbea0446c30a27ca
  Author: Stefano Garzarella <sgarzare@redhat.com>
  Date:   2021-07-21 (Wed, 21 Jul 2021)

  Changed paths:
    M include/block/aio.h
    M include/sysemu/iothread.h
    M iothread.c
    M monitor/hmp-cmds.c
    M qapi/misc.json
    M qapi/qom.json
    M qemu-options.hx
    M util/aio-posix.c
    M util/aio-win32.c
    M util/async.c

  Log Message:
  -----------
  iothread: add aio-max-batch parameter

The `aio-max-batch` parameter will be propagated to AIO engines
and it will be used to control the maximum number of queued requests.

When there are in queue a number of requests equal to `aio-max-batch`,
the engine invokes the system call to forward the requests to the kernel.

This parameter allows us to control the maximum batch size to reduce
the latency that requests might accumulate while queued in the AIO
engine queue.

If `aio-max-batch` is equal to 0 (default value), the AIO engine will
use its default maximum batch size value.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-id: 20210721094211.69853-3-sgarzare@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: d7ddd0a1618a75b31dc308bb37365ce1da972154
      
https://github.com/qemu/qemu/commit/d7ddd0a1618a75b31dc308bb37365ce1da972154
  Author: Stefano Garzarella <sgarzare@redhat.com>
  Date:   2021-07-21 (Wed, 21 Jul 2021)

  Changed paths:
    M block/linux-aio.c

  Log Message:
  -----------
  linux-aio: limit the batch size using `aio-max-batch` parameter

When there are multiple queues attached to the same AIO context,
some requests may experience high latency, since in the worst case
the AIO engine queue is only flushed when it is full (MAX_EVENTS) or
there are no more queues plugged.

Commit 2558cb8dd4 ("linux-aio: increasing MAX_EVENTS to a larger
hardcoded value") changed MAX_EVENTS from 128 to 1024, to increase
the number of in-flight requests. But this change also increased
the potential maximum batch to 1024 elements.

When there is a single queue attached to the AIO context, the issue
is mitigated from laio_io_unplug() that will flush the queue every
time is invoked since there can't be others queue plugged.

Let's use the new `aio-max-batch` IOThread parameter to mitigate
this issue, limiting the number of requests in a batch.

We also define a default value (32): this value is obtained running
some benchmarks and it represents a good tradeoff between the latency
increase while a request is queued and the cost of the io_submit(2)
system call.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-id: 20210721094211.69853-4-sgarzare@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: 29c7daa00722e84a54f16cd0df46d289146dcda1
      
https://github.com/qemu/qemu/commit/29c7daa00722e84a54f16cd0df46d289146dcda1
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-07-21 (Wed, 21 Jul 2021)

  Changed paths:
    M block/linux-aio.c
    M include/block/aio.h
    M include/sysemu/iothread.h
    M iothread.c
    M monitor/hmp-cmds.c
    M qapi/misc.json
    M qapi/qom.json
    M qemu-options.hx
    M util/aio-posix.c
    M util/aio-win32.c
    M util/async.c

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

Pull request

Stefano's performance regression fix for commit 2558cb8dd4 ("linux-aio:
increasing MAX_EVENTS to a larger hardcoded value").

# gpg: Signature made Wed 21 Jul 2021 14:12:47 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-gitlab/tags/block-pull-request:
  linux-aio: limit the batch size using `aio-max-batch` parameter
  iothread: add aio-max-batch parameter
  iothread: generalize iothread_set_param/iothread_get_param

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


Compare: https://github.com/qemu/qemu/compare/033bd16b8afb...29c7daa00722



reply via email to

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