Whamcloud - gitweb
LU-7734 lnet: proper cpt locking
1. add a per NI credits, which is just the total credits
assigned on NI creation
2. Whenever percpt credits are added or decremented, we
mirror that in the NI credits
3. We use the NI credits to determine best NI
4. After we have completed the peer_ni/ni selection we
determine the cpt to use for locking:
cpt_of_nid(lpni->nid, ni)
The lpni_cpt is not enough to protect all the fields in the
lnet_peer_ni structure. This is due to the fact that multiple
NIs can talk to the same peer, and functions can be called with
different cpts locked. To properly protect the fields in the
lnet_peer_ni structure, a spin lock is introduced for the
purpose.
Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Change-Id: Ief7868c3c8ff7e00ea9e908dd50d8cef77d9f9a4
Reviewed-on: http://review.whamcloud.com/20701