Re: [PATCH] radix-tree: optimization for radix_tree_init_maxnodes

2018-09-09 Thread Matthew Wilcox
On Sun, Sep 09, 2018 at 09:21:00PM +0800, Wang Long wrote: > if i == 0, height_to_maxnodes[i] = 0, > if i >= 1, height_to_maxnodes[i] = height_to_maxnodes[i-1] > + __maxindex(i-1) + 1. > > so delete height_to_maxindex and optimize the calculation of > height_to_maxnod

[PATCH] radix-tree: optimization for radix_tree_init_maxnodes

2018-09-09 Thread Wang Long
if i == 0, height_to_maxnodes[i] = 0, if i >= 1, height_to_maxnodes[i] = height_to_maxnodes[i-1] + __maxindex(i-1) + 1. so delete height_to_maxindex and optimize the calculation of height_to_maxnodes array. Signed-off-by: Wang Long --- lib/radix-tree.c | 13 +