[PATCH V5 00/13] iothread: Support tracking and querying IOThread holders

Zhang Chen posted 13 patches 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260305142459.52559-1-zhangckid@gmail.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>, John Levon <john.levon@nutanix.com>, Thanos Makatos <thanos.makatos@nutanix.com>, "Cédric Le Goater" <clg@redhat.com>, David Hildenbrand <david@kernel.org>, "Dr. David Alan Gilbert" <dave@treblig.org>, Markus Armbruster <armbru@redhat.com>, Zhang Chen <zhangckid@gmail.com>, Li Zhijian <lizhijian@fujitsu.com>, Jason Wang <jasowang@redhat.com>, Eric Blake <eblake@redhat.com>
There is a newer version of this series
block/export/export.c                   |  7 ++-
blockdev.c                              |  9 +++-
hw/block/dataplane/xen-block.c          | 11 ++--
hw/block/virtio-blk.c                   | 15 +++---
hw/scsi/virtio-scsi-dataplane.c         | 17 +++---
hw/vfio-user/proxy.c                    |  9 +++-
hw/virtio/iothread-vq-mapping.c         | 11 ++--
hw/virtio/virtio-balloon.c              | 17 ++++--
include/hw/virtio/iothread-vq-mapping.h |  6 ++-
include/system/iothread.h               |  4 +-
iothread.c                              | 70 ++++++++++++++++++++++++-
monitor/hmp-cmds.c                      | 13 +++++
monitor/monitor.c                       |  4 +-
monitor/qmp.c                           |  3 +-
net/colo-compare.c                      | 23 +++++---
qapi/misc.json                          | 25 ++++++++-
16 files changed, 198 insertions(+), 46 deletions(-)
[PATCH V5 00/13] iothread: Support tracking and querying IOThread holders
Posted by Zhang Chen 1 month, 1 week ago
Motivation
Currently, IOThread references are opaque. This series introduces
"holder" tracking via QOM paths to improve observability,
especially for persistent thread pools.

In hotplug scenarios, users often pre-allocate multiple
IOThreads to serve as a pool. When devices are hot-unplugged,
IOThreads are released but remain available for subsequent reuse.
This series allows users to monitor exactly which devices are
currently attached to which IOThread in the pool.

Changes
Core API: Replaced raw object_ref/unref with iothread_get/put_aio_context(..., holder).

Subsystems: Migrated Virtio (blk, vq-mapping, balloon), Block (export, xen),
            Net (COLO), and VFIO to the new API.

Observability: Added holders (a array of QOM paths) to query-iothreads
               and info iothreads.

Thanks
Chen

Zhang Chen (13):
  qapi/misc: Fix missed query-iothreads items
  iothread: introduce iothread_ref/unref to track attached devices
  iothread: tracking iothread users with holder name
  blockdev: Update tracking iothread users with holder name
  virtio-vq-mapping: track iothread-vq-mapping references using device
    path
  virtio: use iothread_get/put_aio_context for thread pinning
  net/colo: track IOThread references using path-based holder
  block/export: Update tracking iothread users with holder name
  monitor: Update tracking iothread users with holder name
  virtio-balloon: Update tracking iothread users with holder name
  vfio-user/proxy: Update tracking iothread users with holder name
  xen-block: Update tracking iothread users with holder name
  qapi: examine IOThread attachment status via query-iothreads

 block/export/export.c                   |  7 ++-
 blockdev.c                              |  9 +++-
 hw/block/dataplane/xen-block.c          | 11 ++--
 hw/block/virtio-blk.c                   | 15 +++---
 hw/scsi/virtio-scsi-dataplane.c         | 17 +++---
 hw/vfio-user/proxy.c                    |  9 +++-
 hw/virtio/iothread-vq-mapping.c         | 11 ++--
 hw/virtio/virtio-balloon.c              | 17 ++++--
 include/hw/virtio/iothread-vq-mapping.h |  6 ++-
 include/system/iothread.h               |  4 +-
 iothread.c                              | 70 ++++++++++++++++++++++++-
 monitor/hmp-cmds.c                      | 13 +++++
 monitor/monitor.c                       |  4 +-
 monitor/qmp.c                           |  3 +-
 net/colo-compare.c                      | 23 +++++---
 qapi/misc.json                          | 25 ++++++++-
 16 files changed, 198 insertions(+), 46 deletions(-)

-- 
2.49.0