> > +   down(&file->mutex);
> >     if (!list_empty(&file->events))
> >             mask = POLLIN | POLLRDNORM;
> > +   up(&file->mutex);
>
>Actually, could you give a little more detail about why this is
>needed, if only for the changelog?  I don't see what putting the mutex
>around the list_empty() test buys you -- the list_empty() test already
>is pretty atomic I think.

This was added to the code a while ago; I was just reporting the diffs.  I think
it was added when debugging some DAPL issues, which turned out to be unrelated.
(DAPL was getting an event, but poll was returning none.)

Looking at the implementation for list_empty(), I don't think that acquiring the
mutex is necessary, as long as events are queued before any waiting threads are
signaled.

- Sean

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to