From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: Userspace hypercalls? Date: Mon, 27 Aug 2007 16:06:01 -0500 Message-ID: <1188248761.21696.4.camel@squirrel> References: <1188228447.12698.8.camel@squirrel> <46D2F8FA.6050104@qumranet.com> <46D2FCE1.7020605@qumranet.com> <46D3001A.9070706@qumranet.com> <1188235942.6364.12.camel@squirrel> <46D30BAE.4080705@qumranet.com> <1188236842.6364.18.camel@squirrel> <46D30F15.6050601@qumranet.com> <68676e00708271258o278de93ek8a051619dd03fb6a@mail.gmail.com> <46D32DA8.1080900@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Avi Kivity Return-path: In-Reply-To: <46D32DA8.1080900-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org On Mon, 2007-08-27 at 23:01 +0300, Avi Kivity wrote: > Luca wrote: > >> 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. I agree that we should start with an exit and then later add an eventfd mechanism if it is needed. Regards, Anthony Liguori ------------------------------------------------------------------------- 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/