On 6/16/26 16:44, Gregory Price wrote: > On Tue, Jun 16, 2026 at 04:32:46PM +0200, David Hildenbrand (Arm) wrote: >> On 6/16/26 15:57, Gregory Price wrote: >>> >>> Definitely an RFC here because I'm not sure if I was missing something >>> that might help me solve the problem. >> >> Well, in QEMU we just run a timer internally that does the polling. >> >> Then, upper layers in the stack can ask QEMU for the latest stats. >> >> There, you just get the stats along with a "last-update" timestamp. >> > > That makes sense, although don't you just push the blocking operation > into yet another thread on the host?
I think timers are run from the QEMU main thread, so no separate thread just for the timer. And IIRC, there will be no blocking. At least if I understand your concern correctly. balloon_stats_poll_cb() will do a virtqueue_push()+virtio_notify(), which will notify the device. The main thread will continue afterwards doing what a main thread usually does. A VCPU will process the request in the VM and send it back + notify the device. -- Cheers, David

