Hi Nick,
On Thu, Nov 10, 2005 at 10:31:09AM +1100, Nick Piggin wrote:
Does this cache add much performance compared with simple repeatedIt just guarantees constant lookup time for small/large files.
lookups? If the access patterns are highly local, the top of the
radix tree should be in cache.
My context based read-ahead code has been quite tricky just to avoid many radix
tree lookups. I made it much simple and robust in the recent versions by just
scanning through the cache. With the help of look-aside cache, the performance
remains comparable with the tricky one. Sorry, the oprofile log was overwrote.
But if you do need some numbers about the cache, I'll make one.
Do you think you could provide a simple 'use case' for an overviewOk, here it is:
of how you use the cache and what calls to make?
void func() {
+ struct radix_tree_cache cache;
+
+ radix_tree_cache_init(&cache);
read_lock_irq(&mapping->tree_lock);
for(;;) {
- page = radix_tree_lookup(&mapping->page_tree, index);
+ page = radix_tree_cache_lookup(&mapping->page_tree, &cache, index);
}
read_unlock_irq(&mapping->tree_lock);
}