Whamcloud - gitweb
LU-12678 lnet: discard ksnn_lock
This lock in 'struct ksock_net' is being taken in places where it
isn't needed, so it is worth cleaning up.
It isn't needed when checking if ksnn_npeers has reached
0 yet, as at that point in the code, the value can only
decrement to zero and then stay there.
It is only needed:
- to ensure concurrent updates to ksnn_npeers don't race, and
- to ensure that no more peers are added after the net is shutdown.
The first is best achieved using atomic_t.
The second is more easily achieved by replacing the ksnn_shutdown
flag with a large negative bias on ksnn_npeers, and using
atomic_inc_unless_negative().
So change ksnn_npeers to atomic_t and discard ksnn_lock
and ksnn_shutdown.
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I23dd07ef89c7abc14f5a5fef28468a62f7b2a35c
Reviewed-on: https://review.whamcloud.com/36834
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>