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

Michael S. Tsirkin mst at mellanox.co.il
Mon May 8 22:36:08 PDT 2006


Quoting r. Sean Hefty <sean.hefty at intel.com>:
> Ah, I was looking around the kernel include files for some sort of signaled
> event.  A completion looks like it's exactly what we want.  Would replacing
> wake_up() with complete() and wait_event() with wait_for_completion() work?

Yea but notice wait_for_completion does not have a condition, so you have to

if (!atomic_dec_and_test())
	wait_for_completion()

and don't forget you must initialize the condition before each use.

-- 
MST



More information about the general mailing list