Hi Stefano,

On Fri, Oct 23, 2026 at 6:01 PM Stefano Garzarella <[email protected]> wrote:
>
> On Thu, 22 Oct 2026 at 15:48, Tim Pambor <[email protected]> wrote:
> >
> > This series continues the work started by Stefano [1] to add support
> > for any POSIX system to vhost-user.
>
> Cool, thanks for doing this!
>
> >
> > Three patches from his original series were never applied due to failing
> > tests [2]. I was able to reproduce these test failures on current master.
>
> Oh, nice, I'm curious, how did you arrive at the fix?

I was only able to reproduce it under high CPU load, so I looked into what
changes with load. Looking at the trace of a failing run, QEMU sat in poll()
waiting for an event from the moment of the disconnect until the test failed.
Only then did it notice the disconnect, because the test’s other sockets,
e.g. the qtest control socket, were closed when the test died. The vhost-user
chardev had no reader, so before the fix its only poll interest was G_IO_HUP,
which does not wake poll() on FreeBSD. The qtest chardev has a front-end
that reads, so it was also polled with G_IO_IN, and that close did wake the
loop.

I also checked why it passes under low load. There, the disconnect coincides
with the DRIVER_OK handshake (virtio_net_setup -> qvirtio_set_driver_ok).
That access wakes the event loop, where the already pending hang-up is
reported in the same poll() return, and the disconnect gets processed in time.
Under high load this no longer lines up: the status read-back is already over
when the close happens, and nothing is left to wake the event loop.

>
> >
> > Patch 4 contains a fix for this problem. Patches 1-3 fix further issues I
> > identified on macOS. Patches 5-7 are the three unmodified patches from
> > Stefano's patch series. Patch 8 contains another bugfix I came across
> > while testing.
>
> Great, I'll review next week.

Thanks,
Tim

Reply via email to