1 From: Alexander Duyck <alexander.h.duyck@redhat.com>
2 Date: Thu, 22 Jan 2015 15:51:33 -0800
3 Subject: [PATCH] fib_trie: Use empty_children instead of counting empty nodes
6 It doesn't make much sense to count the pointers ourselves when
7 empty_children already has a count for the number of NULL pointers stored
8 in the tnode. As such save ourselves the cycles and just use
11 Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
12 Signed-off-by: David S. Miller <davem@davemloft.net>
15 --- a/net/ipv4/fib_trie.c
16 +++ b/net/ipv4/fib_trie.c
17 @@ -1954,16 +1954,10 @@ static void trie_collect_stats(struct tr
18 hlist_for_each_entry_rcu(li, &n->list, hlist)
24 if (n->bits < MAX_STAT_DEPTH)
25 s->nodesizes[n->bits]++;
27 - for (i = tnode_child_length(n); i--;) {
28 - if (!rcu_access_pointer(n->child[i]))
31 + s->nullpointers += n->empty_children;