[rfc][patch] radix-tree: small data structure

From: Nick Piggin
Date: Sun Apr 23 2006 - 11:50:43 EST


With the previous patch, the radix_tree_node budget on my 64-bit
desktop is cut from 20MB to 10MB. This patch should cut it again
by nearly a factor of 4 (haven't verified, but 98ish % of files
are under 64K).

I wonder if this would be of any interest for those who enable
CONFIG_BASE_SMALL?

--
SUSE Labs, Novell Inc.
Index: rtth/radix-tree.c
===================================================================
--- rtth.orig/radix-tree.c 2006-04-22 18:40:38.000000000 +1000
+++ rtth/radix-tree.c 2006-04-23 04:46:15.000000000 +1000
@@ -458,9 +458,8 @@ EXPORT_SYMBOL(radix_tree_tag_clear);
*
* Return values:
*
- * 0: tag not present
+ * 0: tag not set or not present
* 1: tag present, set
- * -1: tag present, unset
*/
int radix_tree_tag_get(struct radix_tree_root *root,
unsigned long index, unsigned int tag)
@@ -494,7 +493,7 @@ int radix_tree_tag_get(struct radix_tree
int ret = tag_get(slot, tag, offset);

BUG_ON(ret && saw_unset_tag);
- return ret ? 1 : -1;
+ return ret;
}
slot = slot->slots[offset];
shift -= RADIX_TREE_MAP_SHIFT;