A question about priority search tree in kernel 2.6.24

2017-02-11 Thread Hao Lee
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.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: A question about priority search tree in kernel 2.6.24

2017-02-11 Thread Greg KH
On Sat, Feb 11, 2017 at 11:42:39PM +0800, Hao Lee wrote:
> 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.

2.6.24 is _very_ very very old, and obsolete and insecure.  Never use it
for anything.  Including trying to understand code, if you just want to
read stuff, please start with 4.9 at the oldest.

good luck!

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies