linux/net/tipc
Ying Xue 07f6c4bc04 tipc: convert tipc reference table to use generic rhashtable
As tipc reference table is statically allocated, its memory size
requested on stack initialization stage is quite big even if the
maximum port number is just restricted to 8191 currently, however,
the number already becomes insufficient in practice. But if the
maximum ports is allowed to its theory value - 2^32, its consumed
memory size will reach a ridiculously unacceptable value. Apart from
this, heavy tipc users spend a considerable amount of time in
tipc_sk_get() due to the read-lock on ref_table_lock.

If tipc reference table is converted with generic rhashtable, above
mentioned both disadvantages would be resolved respectively: making
use of the new resizable hash table can avoid locking on the lookup;
smaller memory size is required at initial stage, for example, 256
hash bucket slots are requested at the beginning phase instead of
allocating the entire 8191 slots in old mode. The hash table will
grow if entries exceeds 75% of table size up to a total table size
of 1M, and it will automatically shrink if usage falls below 30%,
but the minimum table size is allowed down to 256.

Also converts ref_table_lock to a separate mutex to protect hash table
mutations on write side. Lastly defers the release of the socket
reference using call_rcu() to allow using an RCU read-side protected
call to rhashtable_lookup().

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Acked-by: Erik Hugne <erik.hugne@ericsson.com>
Cc: Thomas Graf <tgraf@suug.ch>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-08 19:47:14 -08:00
..
addr.c tipc: compress out gratuitous extra carriage returns 2012-04-30 15:53:56 -04:00
addr.h tipc: explicitly include core.h in addr.h 2014-02-13 17:49:13 -05:00
bcast.c tipc: fix missing spinlock init and nullptr oops 2014-12-09 13:41:54 -05:00
bcast.h tipc: use generic SKB list APIs to manage TIPC outgoing packet chains 2014-11-26 12:30:17 -05:00
bearer.c tipc: fix sparse warnings in new nl api 2014-11-24 16:10:23 -05:00
bearer.h tipc: use generic SKB list APIs to manage link receive queue 2014-11-26 12:30:17 -05:00
config.c tipc: convert tipc reference table to use generic rhashtable 2015-01-08 19:47:14 -08:00
config.h tipc: obsolete the remote management feature 2014-03-27 13:08:36 -04:00
core.c tipc: convert tipc reference table to use generic rhashtable 2015-01-08 19:47:14 -08:00
core.h tipc: convert tipc reference table to use generic rhashtable 2015-01-08 19:47:14 -08:00
discover.c tipc: clean up neigbor discovery message reception 2014-05-14 15:19:48 -04:00
discover.h tipc: fix race in disc create/delete 2014-04-22 21:17:53 -04:00
eth_media.c tipc: improve and extend media address conversion functions 2014-05-14 15:19:48 -04:00
ib_media.c tipc: improve and extend media address conversion functions 2014-05-14 15:19:48 -04:00
Kconfig tipc: convert tipc reference table to use generic rhashtable 2015-01-08 19:47:14 -08:00
link.c tipc: replace 0 by NULL for pointers 2014-12-31 13:11:39 -05:00
link.h tipc: use generic SKB list APIs to manage TIPC outgoing packet chains 2014-11-26 12:30:17 -05:00
log.c tipc: remove print_buf and deprecated log buffer code 2012-07-13 19:34:43 -04:00
Makefile tipc: remove node subscription infrastructure 2014-11-26 12:30:16 -05:00
msg.c put iov_iter into msghdr 2014-12-09 16:29:03 -05:00
msg.h tipc: use generic SKB list APIs to manage TIPC outgoing packet chains 2014-11-26 12:30:17 -05:00
name_distr.c tipc: convert name table read-write lock to RCU 2014-12-08 20:39:57 -05:00
name_distr.h tipc: remove node subscription infrastructure 2014-11-26 12:30:16 -05:00
name_table.c tipc: avoid double lock 'spin_lock:&seq->lock' 2014-12-09 18:27:03 -05:00
name_table.h tipc: convert name table read-write lock to RCU 2014-12-08 20:39:57 -05:00
net.c tipc: add net set to new netlink api 2014-11-21 15:01:31 -05:00
net.h tipc: add net set to new netlink api 2014-11-21 15:01:31 -05:00
netlink.c tipc: add name table dump to new netlink api 2014-11-21 15:01:32 -05:00
netlink.h tipc: add publication dump to new netlink api 2014-11-21 15:01:30 -05:00
node.c tipc: fix broadcast wakeup contention after congestion 2014-12-10 14:45:33 -05:00
node.h tipc: use generic SKB list APIs to manage deferred queue of link 2014-11-26 12:30:17 -05:00
server.c net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
server.h tipc: remove all enabled flags from all tipc components 2014-02-22 00:00:15 -05:00
socket.c tipc: convert tipc reference table to use generic rhashtable 2015-01-08 19:47:14 -08:00
socket.h tipc: convert tipc reference table to use generic rhashtable 2015-01-08 19:47:14 -08:00
subscr.c tipc: remove unnecessary INIT_LIST_HEAD 2014-12-08 20:39:57 -05:00
subscr.h tipc: cosmetic realignment of function arguments 2013-06-17 15:53:01 -07:00
sysctl.c tipc: add name distributor resiliency queue 2014-09-01 17:51:48 -07:00