From: Keir Fraser Subject: Re: spinlock requests (was RE: [Patch] don't spin with irq disabled) Date: Fri, 27 Mar 2009 18:12:05 +0000 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 27/03/2009 18:00, "Dan Magenheimer" wrote: >> What try_readlock would that be? There is no such function. > > Oops, my memory was faulty. It is read_lock() itself > that decrements the lock and then re-increments it. > This appeared to be causing the race. When I added > debug code, the problem went away (which was what led > me to the "hack" working version). Well the race is still impossible afaics. Unless your _raw_rw_is_write_locked() was checking for ==0 rather than <=0. I think something fishy was going on in your actual original implementation if is_write_locked(). :-) -- Keir