All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V7 00/14] iothread: Support tracking and querying IOThread holders
@ 2026-05-11 14:04 Zhang Chen
  2026-05-11 14:04 ` [PATCH V7 01/14] qapi/misc: Fix missed query-iothreads items Zhang Chen
                   ` (13 more replies)
  0 siblings, 14 replies; 26+ messages in thread
From: Zhang Chen @ 2026-05-11 14:04 UTC (permalink / raw)
  To: qemu-devel, Dr . David Alan Gilbert, Eric Blake,
	Markus Armbruster, Michael S . Tsirkin, Stefan Hajnoczi
  Cc: Zhang Chen

### Motivation
Currently, the relationship between IOThreads and the resources using them is
opaque. From a management perspective, it is difficult to determine which 
devices or block exports are currently associated with a specific IOThread 
via QMP or HMP.

This series introduces a "holder" tracking mechanism based on QOM paths to  
significantly improve IOThread observability. In high-performance 
virtualization environments, users often pre-allocate a set of IOThreads to  
serve as a persistent thread pool. During device hotplug/unplug cycles, while 
IOThread objects remain persistent, their attachment state changes dynamically.

By tracking these "holders," administrators can use `query-iothreads` to  
monitor the real-time load distribution of the thread pool and identify which 
specific devices (e.g., virtio-blk, BlockExport) are attached to which thread.

### Technical Overview
* Atomic API Design: Merged iothread_get_aio_context and 
  iothread_ref_and_get_aio_context into a single unified function. The new 
  API enforces a 'holder' parameter, making "retrieval" and "tracking" an  
  atomic operation to prevent reference tracking leaks.
* Subsystem Integration: Fully migrated and adapted core modules including 
  Virtio (blk, vq-mapping, balloon, scsi), Block Layer (export, xen), 
  Network (COLO), VFIO, and the Monitor subsystem.
* Introspection: Expanded the IOThreadInfo QAPI structure to include a 
  'holders' array (list of QOM paths), accessible via both 
  query-iothreads (QMP) and info iothreads (HMP).



### V6 -> V7 Changelog
  - Fixed comments issues in patch 02/14 (Thanks Markus).
  - Removed redundant code.
  - Rebased patches on upstream code.
  - Fixed code conflict with latest patches.
  - Added detailed description in git log and code.
  - Added comments for patch 06/14 assuming the monitor is a QOM object,
    Depends on Daniel Berrangé's RFC patch:
    [PATCH RFC 00/17] monitor: turn QMP and HMP into QOM objects


### V5 -> V6 Changelog
* API Refactoring (Breaking Change):
  - Implement the 'union': 'IoThreadHolder' for combine the QOM objects
    and the block-node.
  - Completely merged iothread_get_aio_context variants.
  - The iothread_get_aio_context function now strictly requires a 'holder' 
    argument to ensure every context retrieval is accounted for.
* Expanded Module Coverage:
  - Added holder tracking for the monitor subsystem (tracking threads used 
    by QMP/HMP).
  - Added support for the virtio-scsi dataplane.
* Code Cleanup:
  - Removed redundant and obsolete API declarations.
  - Standardized the use of object_get_canonical_path() across all callers 
    to provide consistent and unique holder names.
* Bug Fixes:
  - Updated qapi/misc.json documentation to fix missing descriptions in
    query-iothreads items.
* Build System:
  - Improved header inclusion logic to avoid redundant declaration errors
    in unit tests.
* QAPI part:
  - Sorry to drop the "Acked-by: Markus Armbruster <armbru@redhat.com>",
    because this version have lots of changes in the:
    [PATCH V6 13/14]qapi: examine IOThread attachment status via query-iothreads



Zhang Chen (14):
  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
  block/export: track IOThread reference in BlockExport
  monitor: 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
  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
  iothread: simplify API by merging iothread_get_aio_context variants

 block/export/export.c                   |  44 +++++++--
 blockdev.c                              |   6 +-
 hw/block/dataplane/xen-block.c          |  10 ++-
 hw/block/virtio-blk.c                   |  13 ++-
 hw/scsi/virtio-scsi-dataplane.c         |  13 ++-
 hw/vfio-user/proxy.c                    |   7 +-
 hw/virtio/iothread-vq-mapping.c         |  11 ++-
 hw/virtio/virtio-balloon.c              |  14 +--
 include/block/block_int-common.h        |   5 ++
 include/block/export.h                  |   6 ++
 include/hw/virtio/iothread-vq-mapping.h |   6 +-
 include/system/iothread.h               |   9 +-
 iothread.c                              | 113 +++++++++++++++++++++++-
 monitor/hmp-cmds.c                      |  22 +++++
 monitor/monitor-internal.h              |   3 +
 monitor/monitor.c                       |  24 ++++-
 monitor/qmp.c                           |   3 +-
 net/colo-compare.c                      |  18 ++--
 qapi/misc.json                          |  71 ++++++++++++++-
 19 files changed, 342 insertions(+), 56 deletions(-)

-- 
2.49.0



^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2026-05-18 13:48 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 14:04 [PATCH V7 00/14] iothread: Support tracking and querying IOThread holders Zhang Chen
2026-05-11 14:04 ` [PATCH V7 01/14] qapi/misc: Fix missed query-iothreads items Zhang Chen
2026-05-11 14:04 ` [PATCH V7 02/14] iothread: introduce iothread_ref/unref to track attached devices Zhang Chen
2026-05-11 18:14   ` Stefan Hajnoczi
2026-05-11 19:15     ` Zhang Chen
2026-05-18 11:58     ` Markus Armbruster
2026-05-18 13:28       ` Zhang Chen
2026-05-18 11:44   ` Markus Armbruster
2026-05-11 14:04 ` [PATCH V7 03/14] iothread: tracking iothread users with holder name Zhang Chen
2026-05-11 18:54   ` Stefan Hajnoczi
2026-05-11 19:06     ` Zhang Chen
2026-05-11 14:04 ` [PATCH V7 04/14] blockdev: Update " Zhang Chen
2026-05-11 19:05   ` Stefan Hajnoczi
2026-05-11 19:25     ` Zhang Chen
2026-05-11 14:04 ` [PATCH V7 05/14] block/export: track IOThread reference in BlockExport Zhang Chen
2026-05-11 14:04 ` [PATCH V7 06/14] monitor: Update tracking iothread users with holder name Zhang Chen
2026-05-18 11:57   ` Markus Armbruster
2026-05-18 13:47     ` Zhang Chen
2026-05-11 14:04 ` [PATCH V7 07/14] virtio-vq-mapping: track iothread-vq-mapping references using device path Zhang Chen
2026-05-11 14:04 ` [PATCH V7 08/14] virtio: use iothread_get/put_aio_context for thread pinning Zhang Chen
2026-05-11 14:04 ` [PATCH V7 09/14] net/colo: track IOThread references using path-based holder Zhang Chen
2026-05-11 14:04 ` [PATCH V7 10/14] virtio-balloon: Update tracking iothread users with holder name Zhang Chen
2026-05-11 14:04 ` [PATCH V7 11/14] vfio-user/proxy: " Zhang Chen
2026-05-11 14:04 ` [PATCH V7 12/14] xen-block: " Zhang Chen
2026-05-11 14:04 ` [PATCH V7 13/14] qapi: examine IOThread attachment status via query-iothreads Zhang Chen
2026-05-11 14:04 ` [PATCH V7 14/14] iothread: simplify API by merging iothread_get_aio_context variants Zhang Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.