A question about priority search tree in kernel 2.6.24

Hao Lee haolee.swjtu at gmail.com
Sat Feb 11 10:42:39 EST 2017


Hi, all

Recently I'm reading "Professional Linux Kernel Architecture" while
referencing the source code of kernel 2.6.24 and I have a question about
priority search tree.

In prio_tree_init function (
http://lxr.free-electrons.com/source/lib/prio_tree.c?v=2.6.24#L71),  array
index_bits_to_maxindex is initialized to 1,3,7,15,31...2^(i+1)-1. I don't
know why it is initialized to these numbers and what is the relationship
between index_bits_to_maxindex and prio_tree_root->index_bits.

Could someone help me? Many Thanks!

Regards,
Hao Lee.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170211/9e1094a2/attachment.html 


More information about the Kernelnewbies mailing list