qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Linux kernel polling for QEMU


From: Avi Kivity
Subject: Re: [Qemu-devel] Linux kernel polling for QEMU
Date: Wed, 7 Dec 2016 12:32:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0



On 12/01/2016 04:35 PM, Paolo Bonzini wrote:
Maybe we could do the same for sockets?  When data is available on a
socket (or when it becomes writable), write to a user memory location.

I, too, have an interest in polling; in my situation most of the polling
happens in userspace.
You are trying to improve on the latency of non-blocking
ppoll(2)/epoll_wait(2) call?
Yes, but the concern is for throughput, not latency.

My main loop looks like

     execute some tasks
     poll from many sources

Since epoll_wait(..., 0) has non-trivial costs, I have to limit the
polling rate, and even so it shows up in the profile.  If the cost were
lower, I could poll at a higher frequency, resulting in lower worst-case
latencies for high-priority tasks.
IMHO, the ideal model wouldn't enter the kernel at all unless you _want_
to go to sleep.

Right. Note that if data is available, it doesn't really matter, because you'd have to read() it anyway. It matters for the case where data is not available.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]