[PULL 0/9] Block patches

Failed in applying to current master (apply log)
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>, "Michael S. Tsirkin" <mst@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>
There is a newer version of this series
qapi/qom.json                    |  43 ++++++++--
meson.build                      |  26 +++---
include/block/aio.h              |  10 +++
include/block/thread-pool.h      |   3 +
include/hw/virtio/virtio-scsi.h  |  43 ----------
include/hw/virtio/virtio.h       |   1 +
include/qemu/main-loop.h         |  10 +++
include/sysemu/event-loop-base.h |  41 +++++++++
include/sysemu/iothread.h        |   6 +-
event-loop-base.c                | 140 +++++++++++++++++++++++++++++++
hw/scsi/virtio-scsi-dataplane.c  |   2 +-
hw/scsi/virtio-scsi.c            | 101 +++++++++++++++-------
hw/virtio/virtio.c               |  13 +++
iothread.c                       |  68 +++++----------
util/aio-posix.c                 |   1 +
util/async.c                     |  20 +++++
util/main-loop.c                 |  65 ++++++++++++++
util/thread-pool.c               |  55 +++++++++++-
18 files changed, 505 insertions(+), 143 deletions(-)
create mode 100644 include/sysemu/event-loop-base.h
create mode 100644 event-loop-base.c
[PULL 0/9] Block patches
Posted by Stefan Hajnoczi 1 year, 11 months ago
The following changes since commit 554623226f800acf48a2ed568900c1c968ec9a8b:

  Merge tag 'qemu-sparc-20220508' of https://github.com/mcayland/qemu into staging (2022-05-08 17:03:26 -0500)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 3dc584abeef0e1277c2de8c1c1974cb49444eb0a:

  virtio-scsi: move request-related items from .h to .c (2022-05-09 10:45:04 +0100)

----------------------------------------------------------------
Pull request

- Add new thread-pool-min/thread-pool-max parameters to control the thread pool
  used for async I/O.

- Fix virtio-scsi IOThread 100% CPU consumption QEMU 7.0 regression.

----------------------------------------------------------------

Nicolas Saenz Julienne (3):
  Introduce event-loop-base abstract class
  util/main-loop: Introduce the main loop into QOM
  util/event-loop-base: Introduce options to set the thread pool size

Stefan Hajnoczi (6):
  virtio-scsi: fix ctrl and event handler functions in dataplane mode
  virtio-scsi: don't waste CPU polling the event virtqueue
  virtio-scsi: clean up virtio_scsi_handle_event_vq()
  virtio-scsi: clean up virtio_scsi_handle_ctrl_vq()
  virtio-scsi: clean up virtio_scsi_handle_cmd_vq()
  virtio-scsi: move request-related items from .h to .c

 qapi/qom.json                    |  43 ++++++++--
 meson.build                      |  26 +++---
 include/block/aio.h              |  10 +++
 include/block/thread-pool.h      |   3 +
 include/hw/virtio/virtio-scsi.h  |  43 ----------
 include/hw/virtio/virtio.h       |   1 +
 include/qemu/main-loop.h         |  10 +++
 include/sysemu/event-loop-base.h |  41 +++++++++
 include/sysemu/iothread.h        |   6 +-
 event-loop-base.c                | 140 +++++++++++++++++++++++++++++++
 hw/scsi/virtio-scsi-dataplane.c  |   2 +-
 hw/scsi/virtio-scsi.c            | 101 +++++++++++++++-------
 hw/virtio/virtio.c               |  13 +++
 iothread.c                       |  68 +++++----------
 util/aio-posix.c                 |   1 +
 util/async.c                     |  20 +++++
 util/main-loop.c                 |  65 ++++++++++++++
 util/thread-pool.c               |  55 +++++++++++-
 18 files changed, 505 insertions(+), 143 deletions(-)
 create mode 100644 include/sysemu/event-loop-base.h
 create mode 100644 event-loop-base.c

-- 
2.35.1
Re: [PULL 0/9] Block patches
Posted by Philippe Mathieu-Daudé via 1 year, 11 months ago
Hi Stefan, Nicolas,

On Mon, May 9, 2022 at 3:14 PM Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> The following changes since commit 554623226f800acf48a2ed568900c1c968ec9a8b:
>
>   Merge tag 'qemu-sparc-20220508' of https://github.com/mcayland/qemu into staging (2022-05-08 17:03:26 -0500)
>
> are available in the Git repository at:
>
>   https://gitlab.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 3dc584abeef0e1277c2de8c1c1974cb49444eb0a:
>
>   virtio-scsi: move request-related items from .h to .c (2022-05-09 10:45:04 +0100)
>
> ----------------------------------------------------------------
> Pull request
>
> - Add new thread-pool-min/thread-pool-max parameters to control the thread pool
>   used for async I/O.
>
> - Fix virtio-scsi IOThread 100% CPU consumption QEMU 7.0 regression.
>
> ----------------------------------------------------------------
>
> Nicolas Saenz Julienne (3):
>   Introduce event-loop-base abstract class
>   util/main-loop: Introduce the main loop into QOM
>   util/event-loop-base: Introduce options to set the thread pool size

I'm getting this warning on Darwin:

...
[379/1097] Linking static target libevent-loop-base.a
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
archive library: libevent-loop-base.a the table of contents is empty
(no object file members in the library define global symbols)
...

Having:

$ nm libevent-loop-base.a

libevent-loop-base.a(event-loop-base.c.o):
00000000000005d0 d _.compoundliteral
                 U ___stack_chk_fail
                 U ___stack_chk_guard
00000000000005e0 d _aio_max_batch_info
0000000000000000 t _do_qemu_init_register_types
                 U _error_setg_internal
00000000000001d4 t _event_loop_base_can_be_deleted
0000000000000054 t _event_loop_base_class_init
0000000000000138 t _event_loop_base_complete
0000000000000260 t _event_loop_base_get_param
0000000000000400 s _event_loop_base_info
000000000000001c t _event_loop_base_instance_init
00000000000002c4 t _event_loop_base_set_param
                 U _object_class_dynamic_cast_assert
                 U _object_class_property_add
                 U _object_dynamic_cast_assert
                 U _object_get_class
                 U _register_module_init
0000000000000010 t _register_types
0000000000000600 d _thread_pool_max_info
00000000000005f0 d _thread_pool_min_info
                 U _type_register_static
                 U _visit_type_int64
0000000000000468 s l_.str
0000000000000478 s l_.str.1
00000000000005a6 s l_.str.10
000000000000047f s l_.str.2
000000000000048e s l_.str.3
00000000000004d9 s l_.str.4
00000000000004e7 s l_.str.5
00000000000004eb s l_.str.6
00000000000004fb s l_.str.7
000000000000050b s l_.str.8
0000000000000574 s l_.str.9
00000000000004c9 s l___func__.EVENT_LOOP_BASE
000000000000055a s l___func__.EVENT_LOOP_BASE_GET_CLASS
0000000000000545 s l___func__.USER_CREATABLE_CLASS
000000000000058c s l___func__.event_loop_base_set_param
0000000000000000 t ltmp0
0000000000000400 s ltmp1
0000000000000468 s ltmp2
00000000000005d0 d ltmp3
0000000000000610 s ltmp4
0000000000002b78 s ltmp5

Maybe smth missing on the meson side? (+Paolo)

$ git-diff 554623226..178bacb66 meson.build
...
+event_loop_base = files('event-loop-base.c')
+event_loop_base = static_library('event-loop-base', sources:
event_loop_base + genh,
+                                 build_by_default: true)
+event_loop_base = declare_dependency(link_whole: event_loop_base,
+                                     dependencies: [qom])
...

Any clue?
Re: [PULL 0/9] Block patches
Posted by Philippe Mathieu-Daudé via 1 year, 11 months ago
On Thu, May 12, 2022 at 12:29 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Hi Stefan, Nicolas,
>
> > Nicolas Saenz Julienne (3):
> >   Introduce event-loop-base abstract class
> >   util/main-loop: Introduce the main loop into QOM
> >   util/event-loop-base: Introduce options to set the thread pool size
>
> I'm getting this warning on Darwin:
>
> ...
> [379/1097] Linking static target libevent-loop-base.a
> warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
> archive library: libevent-loop-base.a the table of contents is empty
> (no object file members in the library define global symbols)
> ...

Opened https://gitlab.com/qemu-project/qemu/-/issues/1044 to track this.
Re: [PULL 0/9] Block patches
Posted by Richard Henderson 1 year, 11 months ago
On 5/9/22 07:53, Stefan Hajnoczi wrote:
> The following changes since commit 554623226f800acf48a2ed568900c1c968ec9a8b:
> 
>    Merge tag 'qemu-sparc-20220508' of https://github.com/mcayland/qemu into staging (2022-05-08 17:03:26 -0500)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/stefanha/qemu.git tags/block-pull-request
> 
> for you to fetch changes up to 3dc584abeef0e1277c2de8c1c1974cb49444eb0a:
> 
>    virtio-scsi: move request-related items from .h to .c (2022-05-09 10:45:04 +0100)
> 
> ----------------------------------------------------------------
> Pull request
> 
> - Add new thread-pool-min/thread-pool-max parameters to control the thread pool
>    used for async I/O.
> 
> - Fix virtio-scsi IOThread 100% CPU consumption QEMU 7.0 regression.

Applied, thanks.  Please update https://wiki.qemu.org/ChangeLog/7.1 as appropriate.


r~


> 
> ----------------------------------------------------------------
> 
> Nicolas Saenz Julienne (3):
>    Introduce event-loop-base abstract class
>    util/main-loop: Introduce the main loop into QOM
>    util/event-loop-base: Introduce options to set the thread pool size
> 
> Stefan Hajnoczi (6):
>    virtio-scsi: fix ctrl and event handler functions in dataplane mode
>    virtio-scsi: don't waste CPU polling the event virtqueue
>    virtio-scsi: clean up virtio_scsi_handle_event_vq()
>    virtio-scsi: clean up virtio_scsi_handle_ctrl_vq()
>    virtio-scsi: clean up virtio_scsi_handle_cmd_vq()
>    virtio-scsi: move request-related items from .h to .c
> 
>   qapi/qom.json                    |  43 ++++++++--
>   meson.build                      |  26 +++---
>   include/block/aio.h              |  10 +++
>   include/block/thread-pool.h      |   3 +
>   include/hw/virtio/virtio-scsi.h  |  43 ----------
>   include/hw/virtio/virtio.h       |   1 +
>   include/qemu/main-loop.h         |  10 +++
>   include/sysemu/event-loop-base.h |  41 +++++++++
>   include/sysemu/iothread.h        |   6 +-
>   event-loop-base.c                | 140 +++++++++++++++++++++++++++++++
>   hw/scsi/virtio-scsi-dataplane.c  |   2 +-
>   hw/scsi/virtio-scsi.c            | 101 +++++++++++++++-------
>   hw/virtio/virtio.c               |  13 +++
>   iothread.c                       |  68 +++++----------
>   util/aio-posix.c                 |   1 +
>   util/async.c                     |  20 +++++
>   util/main-loop.c                 |  65 ++++++++++++++
>   util/thread-pool.c               |  55 +++++++++++-
>   18 files changed, 505 insertions(+), 143 deletions(-)
>   create mode 100644 include/sysemu/event-loop-base.h
>   create mode 100644 event-loop-base.c
>