[openib-general] Re: [PATCH][RFC] kDAPL: use linux native timers instead of own
Tom Duffy
tduffy at sun.com
Tue May 24 14:48:52 PDT 2005
On Tue, 2005-05-24 at 14:40 -0400, James Lentini wrote:
> Tom,
>
> This looks very good. A few comments:
>
> - Do we need to convert the timeout from milliseconds to jiffies?
>
> DAT timeout values are in milliseconds and kernel timers are in
> jiffies. I think we need to convert from milliseconds to jiffies
> before setting up a timer.
You are right. In kernel stuff tends to be in jiffies, and we could say
that in kernel DAT is jiffies, but userland would have to do the
conversion.
> - Is it safe to use del_timer()?
>
> Currently, kDAPL assumes that any function may be called from an
> interrupt (hence the use of spin_lock_irqsave(), etc). This
> precludes us from using del_timer_sync(), but I think there are
> scenarios in which we could get into trouble by using del_timer().
>
> For example, suppose we are on an SMP machine and the timeout
> occurs. While dapl_ep_timeout() is running on one processor, the
> kDAPL consumer calls dat_ep_free() on another processor. Now one
> processor would free the DAPL_EP structure's memory while it was
> being used by dapl_ep_timeout() and its callees. Could this be
> fixed by simply moving line 260 of dapl_ep_util.c to the end
> of dapl_ep_timeout and updating dapl_ep_free to return if the
> ep state is DAT_EP_STATE_ACTIVE_CONNECTION_PENDING?
You know the code better than I do. That seems like a good idea, given
a quick glance.
-tduffy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20050524/6f0b23ba/attachment.sig>
More information about the general
mailing list