[openib-general] Re: userspace event reporting

Libor Michalek libor at topspin.com
Wed Jul 20 16:46:06 PDT 2005


On Tue, Jul 12, 2005 at 11:53:06AM -0700, Sean Hefty wrote:
> This fell out of the uCM connection ID discussion...
> 
> There's an issue reporting events to userspace clients for an object that
> a user may have destroyed.  The problem exists with user verbs, but is
> much more likely to be seen by a userspace CM client.  To avoid reporting
> events for a destroyed object, I think that something similar to the
> following could be used from userspace:
> 
> destroy() should set a state marking destruction and wait for a reference
> count to go to 0 before transitioning to the kernel.  The kernel code
> should destroy the associated kernel object and then discard any unclaimed
> events.
> 
> get_event() should check the object state and discard the event if the
> object is being destroyed.  It should increment a reference count before
> reporting any events.
> 
> put_event() should decrement the reference count and unblock destroy if
> the reference count goes to 0.

  Just a little background. I had left out the user defined context
variable because of the race condition, and I didn't try to solve
the race condition on purpose. The reason is that I can see a few
ways for the user to solve this themselves, entirely in userspace,
depending on the threading model being used. For example, the above 
can be done entirely in userspace.

  I could be convinced otherwise, but that was the thinking.

  
-Libor



More information about the general mailing list