aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2018-03-29 17:20:41 -0400
committerDavid S. Miller <davem@davemloft.net>2018-03-31 22:19:52 -0400
commit218527fe27adaebeb81eb770459eb335517e90ee (patch)
tree42001e81e0214aedd8d42ebf810f4d7542ce6a8a /net/tipc/node.c
parent24197ee2102359b59044234347dd3504302fa97d (diff)
tipc: replace name table service range array with rb tree
The current design of the binding table has an unnecessary memory consuming and complex data structure. It aggregates the service range items into an array, which is expanded by a factor two every time it becomes too small to hold a new item. Furthermore, the arrays never shrink when the number of ranges diminishes. We now replace this array with an RB tree that is holding the range items as tree nodes, each range directly holding a list of bindings. This, along with a few name changes, improves both readability and volume of the code, as well as reducing memory consumption and hopefully improving cache hit rate. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 4fb4327311bb..85e777e00ec9 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -324,12 +324,12 @@ static void tipc_node_write_unlock(struct tipc_node *n)
324 if (flags & TIPC_NOTIFY_LINK_UP) { 324 if (flags & TIPC_NOTIFY_LINK_UP) {
325 tipc_mon_peer_up(net, addr, bearer_id); 325 tipc_mon_peer_up(net, addr, bearer_id);
326 tipc_nametbl_publish(net, TIPC_LINK_STATE, addr, addr, 326 tipc_nametbl_publish(net, TIPC_LINK_STATE, addr, addr,
327 TIPC_NODE_SCOPE, link_id, addr); 327 TIPC_NODE_SCOPE, link_id, link_id);
328 } 328 }
329 if (flags & TIPC_NOTIFY_LINK_DOWN) { 329 if (flags & TIPC_NOTIFY_LINK_DOWN) {
330 tipc_mon_peer_down(net, addr, bearer_id); 330 tipc_mon_peer_down(net, addr, bearer_id);
331 tipc_nametbl_withdraw(net, TIPC_LINK_STATE, addr, 331 tipc_nametbl_withdraw(net, TIPC_LINK_STATE, addr,
332 link_id, addr); 332 link_id, link_id);
333 } 333 }
334} 334}
335 335