Forwarding a patch written by one of our real time kernel guys.
Description of the issue is with the patch.

-- 
Doug Ledford <[EMAIL PROTECTED]>
              GPG KeyID: CFBFF194
              http://people.redhat.com/dledford

Infiniband specific RPMs available at
              http://people.redhat.com/dledford/Infiniband

--- Begin Message ---
RT is very sensitive to the order locks are taken and released
wrt read write locks. We must do

  lock(a);
  lock(b);
  lock(c);

  [...]

  unlock(c);
  unlock(b);
  unlock(a);

otherwise bad things can happen.

Signed-off-by: Steven Rostedt <[EMAIL PROTECTED]>
Index: linux-2.6.24.7.noarch/drivers/infiniband/core/uverbs_cmd.c
===================================================================
--- linux-2.6.24.7.noarch.orig/drivers/infiniband/core/uverbs_cmd.c
+++ linux-2.6.24.7.noarch/drivers/infiniband/core/uverbs_cmd.c
@@ -1118,12 +1118,12 @@ ssize_t ib_uverbs_create_qp(struct ib_uv
                goto err_copy;
        }
 
-       put_pd_read(pd);
-       put_cq_read(scq);
-       if (rcq != scq)
-               put_cq_read(rcq);
        if (srq)
                put_srq_read(srq);
+       if (rcq != scq)
+               put_cq_read(rcq);
+       put_cq_read(scq);
+       put_pd_read(pd);
 
        mutex_lock(&file->mutex);
        list_add_tail(&obj->uevent.uobject.list, &file->ucontext->qp_list);
@@ -1142,14 +1142,14 @@ err_destroy:
        ib_destroy_qp(qp);
 
 err_put:
-       if (pd)
-               put_pd_read(pd);
-       if (scq)
-               put_cq_read(scq);
-       if (rcq && rcq != scq)
-               put_cq_read(rcq);
        if (srq)
                put_srq_read(srq);
+       if (rcq && rcq != scq)
+               put_cq_read(rcq);
+       if (scq)
+               put_cq_read(scq);
+       if (pd)
+               put_pd_read(pd);
 
        put_uobj_write(&obj->uevent.uobject);
        return ret;

--- End Message ---

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

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

Reply via email to