From: Markus Armbruster <armbru@redhat.com>
To: Zhang Chen <zhangckid@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
"Dr . David Alan Gilbert" <dave@treblig.org>,
"Eric Blake" <eblake@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Jason Wang" <jasowang@redhat.com>, "Fam Zheng" <fam@euphon.net>,
"Daniel P . Berrangé" <berrange@redhat.com>
Subject: Re: [RESEND PATCH V10 06/15] monitor: Update tracking iothread users with holder
Date: Fri, 31 Jul 2026 09:23:34 +0200 [thread overview]
Message-ID: <87cxw3aah5.fsf@pond.sub.org> (raw)
In-Reply-To: <CAK3tnv+UMEsZTR12iY74sD42m5nNhYEtyF58QxVoG-JAeUZHcw@mail.gmail.com> (Zhang Chen's message of "Fri, 31 Jul 2026 10:42:29 +0800")
Zhang Chen <zhangckid@gmail.com> writes:
> On Tue, Jul 21, 2026 at 8:33 PM Markus Armbruster <armbru@redhat.com> wrote:
>>
>> Zhang Chen <zhangckid@gmail.com> writes:
>>
>> > Based on monitor QOM path tracking iothread users with holder.
>> > Introduce the AioContext in the Monitor struct to avoid repeated calls to
>> > iothread_get_aio_context() and ensure symmetrical ref/unref during
>> > monitor lifecycle.
>> >
>> > Signed-off-by: Zhang Chen <zhangckid@gmail.com>
>>
>> Why are repeated calls bad?
>>
>> How would symmetry be lost?
>>
>
> OK, will add detailed comments like this in the next version:
>
> Avoid repeated calls: Under the holder tracking model, fetching the
> AioContext increments the IOThread refcount and registers holder metadata.
> Dynamically querying it in helper functions (e.g., suspend, BH scheduling)
> leads to redundant refcount churn.
Right here, we still have
AioContext *iothread_get_aio_context(IOThread *iothread)
{
return iothread->ctx;
}
and complicating code to avoid additional calls feels dubious.
PATCH 14 changes it to
AioContext *iothread_get_aio_context(IOThread *iothread,
const IOThreadHolder *holder)
{
/* Add IOThreadHolder to the list */
iothread_ref(iothread, holder);
return iothread->ctx;
}
Are you making this change in preparation of PATCH 14?
> Ensure lifecycle symmetry: Storing AioContext in mon->ctx establishes a
> strict 1-to-1 lifecycle pairing: a single iothread_ref_and_get_aio_context()
> in monitor_complete() matched by a single iothread_put_aio_context()
> in monitor_cleanup().
>
> Thanks
> Chen
next prev parent reply other threads:[~2026-07-31 7:24 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 17:20 [RESEND PATCH V10 00/15] iothread: Support tracking and querying IOThread holders Zhang Chen
2026-07-16 17:20 ` [RESEND PATCH V10 01/15] qapi/misc: Fix missed query-iothreads items Zhang Chen
2026-07-16 17:20 ` [RESEND PATCH V10 02/15] iothread: introduce iothread_ref/unref to track attached devices Zhang Chen
2026-07-21 12:20 ` Markus Armbruster
2026-07-16 17:20 ` [RESEND PATCH V10 03/15] iothread: tracking iothread users with holder name Zhang Chen
2026-07-16 17:20 ` [RESEND PATCH V10 04/15] iothread: introduce iothread_unsafe_get_aio_context() Zhang Chen
2026-07-16 17:20 ` [RESEND PATCH V10 05/15] block/export: track IOThread reference in BlockExport Zhang Chen
2026-07-16 17:20 ` [RESEND PATCH V10 06/15] monitor: Update tracking iothread users with holder Zhang Chen
2026-07-21 12:33 ` Markus Armbruster
2026-07-31 2:42 ` Zhang Chen
2026-07-31 7:23 ` Markus Armbruster [this message]
2026-07-16 17:20 ` [RESEND PATCH V10 07/15] virtio-vq-mapping: track iothread-vq-mapping references using device path Zhang Chen
2026-07-16 17:20 ` [RESEND PATCH V10 08/15] virtio: use iothread_get/put_aio_context for thread pinning Zhang Chen
2026-07-16 17:20 ` [RESEND PATCH V10 09/15] net/colo: track IOThread references using path-based holder Zhang Chen
2026-07-16 17:20 ` [RESEND PATCH V10 10/15] virtio-balloon: Update tracking iothread users with holder Zhang Chen
2026-07-16 17:20 ` [RESEND PATCH V10 11/15] vfio-user/proxy: Update tracking iothread users with holder name Zhang Chen
2026-07-16 17:20 ` [RESEND PATCH V10 12/15] xen-block: " Zhang Chen
2026-07-16 17:20 ` [RESEND PATCH V10 13/15] monitor/hmp: Add holders support for hmp_info_iothreads Zhang Chen
2026-07-21 12:51 ` Markus Armbruster
2026-07-31 2:33 ` Zhang Chen
2026-07-16 17:20 ` [RESEND PATCH V10 14/15] iothread: simplify API by merging iothread_get_aio_context variants Zhang Chen
2026-07-31 7:43 ` Markus Armbruster
2026-07-16 17:20 ` [RESEND PATCH V10 15/15] tests/unit/iothread: Update the iothread_get_aio_context Zhang Chen
2026-07-21 12:47 ` [RESEND PATCH V10 00/15] iothread: Support tracking and querying IOThread holders Markus Armbruster
2026-07-31 2:27 ` Zhang Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87cxw3aah5.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=dave@treblig.org \
--cc=eblake@redhat.com \
--cc=fam@euphon.net \
--cc=jasowang@redhat.com \
--cc=kwolf@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=zhangckid@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.