From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] qemu-kvm: Consolidate kvm_eat_signals Date: Mon, 12 May 2008 17:42:28 +0300 Message-ID: <48285754.5080600@qumranet.com> References: <482820DC.6030509@web.de> <48282B16.7050006@qumranet.com> <48282D13.9060903@web.de> <48283071.5030600@qumranet.com> <482854D2.50100@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel , Jan Kiszka To: Anthony Liguori Return-path: In-Reply-To: <482854D2.50100@codemonkey.ws> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Anthony Liguori wrote: >> >> Yes. The loop was a (perhaps premature) optimization that is now >> totally unnecessary, unless I'm missing something quite large. >> > > It used to be that kvm_eat_signal() selected after consuming as many > signals as possible while only sleeping once. That's why there's a > combination of sleeping and polling. > Yes. > Now the VCPU threads never select so the whole loop can be simplified > to a single sigtimedwait() that always blocks. > > In reality, I don't think sigtimedwait() is really needed/useful for > VCPUs anymore. We only use it to catch SIG_IPI and we only use > SIG_IPI to break out of sleeping. I don't see any reason why we > couldn't switch over to using a file descriptor for notification (or a > pthread condition). How would you stop a vcpu running in guest mode? > In the very least, we could just select() on nothing and allow SIG_IPI > to break us out of the select. sigtimedwait() (or just sigwait, now) doesn't require the signal to be delivered, so it's faster. If there's nothing to select, why call select()? -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone