From: Keir Fraser Subject: Re: spinlock requests (was RE: [Patch] don't spin with irq disabled) Date: Fri, 03 Apr 2009 08:17:24 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dan Magenheimer , Jan Beulich , Juergen Gross Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 03/04/2009 00:08, "Dan Magenheimer" wrote: >> Well the race is still impossible afaics. Unless your >> _raw_rw_is_write_locked() was checking for ==0 rather than >> <=0. > > Finally got a chance to go back and reproduce and figure > this one out. The crash is still occurring. My code > definitely checks for <=0. BUT the declaration of > raw_rwlock_t declares the lock as "volatile UNSIGNED int", > so the compiler blithely generates a check for == 0. > > Can I assume the fix is to change the declaration to > int instead of unsigned int, or will that cause problems > elsewhere? Oh dear. Yes, that's the fix! -- Keir