I have found that the locking needs on lookup require that
the object be locked before the id-look-up is unlocked.
With out this it is possible to find an object and have it
"removed" by another prior to getting it locked. This is
why, in my version, the lock is exported. I am considering
removing the locking from the id code entirely. The
radix-tree code does it this way. Another issue with
locking is the irq required or not thing. Irq locking is
VERY expensive and getting more so as cpu speeds go up and
I/O speeds stay the same. If it is not needed, it is best
not to use it. Again, exporting the locking to the caller
seems the best answer.
I would much prefer to return memory on release. In my code
I currently only return the leaf nodes, but I consider this
something to be fixed rather than a feature.
While the code is order 1 it does do a divide which, as I
understand it, is rather expensive (risc machines do them
with subroutines). It is rather easy to eliminate the
recursion in an radix-tree AND avoid the div at the same
time.
I would consider moving the "ctr" member to the root of the
tree and using the same one for all allocations. I may be
wrong here, but I think it gives a better cycle time for the
bits used.
-- George Anzinger george@mvista.com High-res-timers: http://sourceforge.net/projects/high-res-timers/ Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/