]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: remove port_lock
authorJon Paul Maloy <jon.maloy@ericsson.com>
Fri, 22 Aug 2014 22:09:16 +0000 (18:09 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 23 Aug 2014 18:18:34 +0000 (11:18 -0700)
commit4bb93b4b8155d201dcc86f99117b66a999006327
treedce467a4bd4be90896e7243f87335e1b41cded75
parente6d64aa8c3493775c01a6edba54bab0e777e1507
tipc: remove port_lock

In previous commits we have reduced usage of port_lock to a minimum,
and complemented it with usage of bh_lock_sock() at the remaining
locations. The purpose has been to remove this lock altogether, since
it largely duplicates the role of bh_lock_sock. We are now ready to do
this.

However, we still need to protect the BH callers from inadvertent
release of the socket while they hold a reference to it. We do this by
replacing port_lock by a combination of a rw-lock protecting the
reference table as such, and updating the socket reference counter while
the socket is referenced from BH. This technique is more standard and
comprehensible than the previous approach, and turns out to have a
positive effect on overall performance.

Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/port.h
net/tipc/ref.c
net/tipc/ref.h
net/tipc/socket.c