Whamcloud - gitweb
LU-12678 lnet: remove locking protection ln_testprotocompat 56/36856/4
authorMr NeilBrown <neilb@suse.de>
Fri, 17 Jan 2020 19:36:51 +0000 (14:36 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 23 Jan 2020 05:31:42 +0000 (05:31 +0000)
commit624364420970f5df04aad5354566bce2b362e4b1
tree0a1839f9c3c2c70c3e8c815e90fe7a36e7b77793
parent4f526f5c20073d7025154d97885ec2fdfe832e1c
LU-12678 lnet: remove locking protection ln_testprotocompat

lnet_net_lock(LNET_LOCK_EX) is a heavy-weight lock that is not
necessary here.  The bits in this field are only set rarely - via an
ioctl - and the pattern for reading and clearing them exactly
matches test_and_clear_bit().  So change the field to "unsigned
long" (so test_and_clear_bit() can be used), and use
test_and_clear_bit(), discarding all other locking.

Test-Parameters: trivial testlist=sanity-lnet
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ie420fcb3d547d9ec04025b921d5b24bd8f2fcce3
Reviewed-on: https://review.whamcloud.com/36856
Reviewed-by: Alexey Lyashkov <c17817@cray.com>
Reviewed-by: Chris Horn <hornc@cray.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/include/lnet/lib-types.h
lnet/klnds/socklnd/socklnd_proto.c
lnet/lnet/acceptor.c
lnet/lnet/api-ni.c