From: John Levon Subject: Re: [PATCH] SCHEDOP_block_masked Date: Fri, 10 Mar 2006 11:43:28 +0000 Message-ID: <20060310114328.GA20647@totally.trollied.org> References: <20060310105824.GA20192@totally.trollied.org> <70594b8262bcb5576c1a1213d88e8d66@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <70594b8262bcb5576c1a1213d88e8d66@cl.cam.ac.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Fri, Mar 10, 2006 at 11:03:17AM +0000, Keir Fraser wrote: > >Introduce SCHEDOP_block_masked, which blocks a VCPU without enabling > >interrupts. > > > >We need this as there are circumstances where we cannot take > >interrupts, > >and are polling in a tight loop. In particular in Solaris's kernel > >debugger console input. We don't want to burn CPU in a domU, but we're > >not in a situation where we can safely use SCHEDOP_block. > > Modified do_block() still checks event_pending, even if you do not > clear the event_mask. Presumably you don't really want to do that? It uses event_pending() which will be zero: 76 #define event_pending(v) \ 77 (!!(v)->vcpu_info->evtchn_upcall_pending & \ 78 !(v)->vcpu_info->evtchn_upcall_mask) But, now you mention it, I wonder if this wouldn't be better taking an event channel to check on before sleeping (though we'd still wake on any). This would avoid the small race (which doesn't really matter in the context we've been using this). regards john