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>
This commit is contained in:

committed by
David S. Miller

parent
24197ee210
commit
218527fe27
@@ -324,12 +324,12 @@ static void tipc_node_write_unlock(struct tipc_node *n)
|
||||
if (flags & TIPC_NOTIFY_LINK_UP) {
|
||||
tipc_mon_peer_up(net, addr, bearer_id);
|
||||
tipc_nametbl_publish(net, TIPC_LINK_STATE, addr, addr,
|
||||
TIPC_NODE_SCOPE, link_id, addr);
|
||||
TIPC_NODE_SCOPE, link_id, link_id);
|
||||
}
|
||||
if (flags & TIPC_NOTIFY_LINK_DOWN) {
|
||||
tipc_mon_peer_down(net, addr, bearer_id);
|
||||
tipc_nametbl_withdraw(net, TIPC_LINK_STATE, addr,
|
||||
link_id, addr);
|
||||
link_id, link_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user