From: Keir Fraser Subject: Re: do_softirq + interrupts Date: Fri, 2 Sep 2005 09:20:28 +0100 Message-ID: <1d1df2cddb778c8690fa3a398fbaae71@cl.cam.ac.uk> References: <200509011814.48047.hollisb@us.ibm.com> Mime-Version: 1.0 (Apple Message framework v622) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <200509011814.48047.hollisb@us.ibm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Hollis Blanchard Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 2 Sep 2005, at 00:14, Hollis Blanchard wrote: > What confuses me is that any other interrupt could come in at point > *** above, > right? That interrupt will follow a very similar path, calling > do_softirq > again, and handle TIMER_SOFTIRQ. Then when the first do_softirq > resumes, the > ASSERT will trip. > > What am I missing? You shouldn't call do_softirq() from nested Xen activations (this is unlike Linux, which is happy to do softirq work from arbitrary interrupt contexts). For example, the main places where arch/x86 calls do_softirq are from within the idle loop, and in our code that exits a Xen activation we have code along the lines of: if (softirq_pending() and returning to guest context) do_softirq(); If you do softirq work in nested interrupt contexts in Xen you will find all kinds of bad races, because the locking strategies assume you don;t do this (most spinlocks are acquired without disabling interrupts, for example). -- Keir