[openib-general] Re: Re: [PATCH] cm refcount race fix

Michael S. Tsirkin mst at mellanox.co.il
Mon May 8 09:23:34 PDT 2006


Quoting r. Michael S. Tsirkin <mst at mellanox.co.il>:
> We can change refcount from atomic to a simple integer, protected
> by lock. And then
> 
> wait_event(&obj->wait, ({
> 		spin_lock_irq(&obj->lock);
> 		count = obj->refcount;
> 		spin_unlock_irq(&obj->lock);
> 		count;
> 		})

Make that

wait_event(&obj->wait, ({
		spin_lock_irq(&obj->lock);
		count = obj->refcount;
		spin_unlock_irq(&obj->lock);
		!count;
		})

-- 
MST



More information about the general mailing list