Luca wrote: > On 8/27/07, Avi Kivity <[EMAIL PROTECTED]> wrote: > >> Anthony Liguori wrote: >> >>> On Mon, 2007-08-27 at 20:36 +0300, Avi Kivity wrote: >>> >>>> userspace can >>>> attach a signal to the eventfd if it wants a synchronous exit (does >>>> eventfd allow fcntl(F_SETOWN)?) >>>> >>> Which would address the latency issue nicely. Looking at the fs code, >>> it looks like eventfd shouldn't have to do anything special for it. >>> >> I'm not sure now. Which thread will be selected for accepting the >> signal? >> > > It's not specified. > >
So that option's down. >> if it isn't guaranteed to be the current thread, we're back >> with scheduler involvement, and possibly cacheline bouncing. >> > > It's possible to use pthread_sigmask() to block the signal on all > threads but one. But this would require changing the rest of the > emulator; why not just select() the fd in a dedicated thread? > When the guest issues that hypercall, it really wants the I/O to start. If it's a separate thread, the scheduler could choose to let the guest execute and keep the I/O thread waiting (CFS isn't likely to do that, but it's possible). The scheduler could also choose to run the I/O thread on a different processor, and now all the data structures carefully loaded into cache by the guest need to be bounced to the processor running the I/O thread. I think the best policy here is to cover our asses and allow userspace to choose which method it wants to use; and we should start with the guest exiting to userspace to avoid the costs I mentioned. -- Any sufficiently difficult bug is indistinguishable from a feature. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel