diff options
author | Sean Hefty <sean.hefty@intel.com> | 2011-02-23 09:05:39 -0800 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2011-03-15 10:57:34 -0700 |
commit | a396d43a35fb91f2d4920a4700d25ecc5ec92404 (patch) | |
tree | 5658f67fe3b18c51c51340b777cbb0fd803376ba /drivers/base/node.c | |
parent | 8d8ac86564b616bc17054cbb6e727588da64c86b (diff) | |
download | blackbird-op-linux-a396d43a35fb91f2d4920a4700d25ecc5ec92404.tar.gz blackbird-op-linux-a396d43a35fb91f2d4920a4700d25ecc5ec92404.zip |
RDMA/cma: Replace global lock in rdma_destroy_id() with id-specific one
rdma_destroy_id currently uses the global rdma cm 'lock' to test if an
rdma_cm_id has been bound to a device. This prevents an active
address resolution callback handler from assigning a device to the
rdma_cm_id after rdma_destroy_id checks for one.
Instead, we can replace the use of the global lock around the check to
the rdma_cm_id device pointer by setting the id state to destroying,
then flushing all active callbacks. The latter is accomplished by
acquiring and releasing the handler_mutex. Any active handler will
complete first, and any newly scheduled handlers will find the
rdma_cm_id in an invalid state.
In addition to optimizing the current locking scheme, the use of the
rdma_cm_id mutex is a more intuitive synchronization mechanism than
that of the global lock. These changes are based on feedback from
Doug Ledford <dledford@redhat.com> while he was trying to debug a
crash in the rdma cm destroy path.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/base/node.c')
0 files changed, 0 insertions, 0 deletions