[openib-general] userspace event reporting

Sean Hefty sean.hefty at intel.com
Tue Jul 12 11:53:06 PDT 2005


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.

I'm at least a week away from trying to work on a patch for this, but I think
that this would work.  (I'm not even sure that we need to set a destroying
state.)  We could then provide user context that could be safely accessed from
an event handler, as long as the user frees the related object after destroy
returns.  Comments?

- Sean




More information about the general mailing list