[ofa-general] Re: [PATCH v2 2/4] rdma/cma: simplify locking neededfor serialization of callbacks

Or Gerlitz or.gerlitz at gmail.com
Tue Jul 8 12:59:19 PDT 2008


On 7/8/08, Roland Dreier <rdreier at cisco.com> wrote:
>
> > Personally, I'm fine either way.  This method can acquire/release the
> mutex
>   > twice, though that's not a big deal.  If we want better encapsulation,
> we could
>   > also add a cma_enable_callback wrapper around the mutex_unlock.
>
> I was thinking about that enable wrapper too... might make everything
> easier to read. (I think the double mutex in some cases is totally
> negligible, and the clearer source more than makes up for it)
>

OK, I just want to make sure I got exactly what you have in mind:

this patch should be fixed to have a

       if (cma_disable_callback(id_priv, CMA_ADDR_BOUND) &&
           cma_disable_callback(id_priv, CMA_ADDR_RESOLVED))

calls in cma_ib_mc_handler and  have a cma_enable_callback wrapper around
the mutex_unlock, correct?

I will be able to do that on Thursday.

the reason for the open coding in cma_ib_mc_handler was an attempt to stay
away from the compiler and avoid potential double locking of a mutex. The
reason for not having a wrapper was that for my taste it was a bit of over
doing, but I am fine with having it if this is your preference as
maintainers.

Or.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080708/89db7c6c/attachment.html>


More information about the general mailing list