[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090110142330.295a8847.akpm@linux-foundation.org>
Date: Sat, 10 Jan 2009 14:23:30 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Jörn Engel <joern@...fs.org>
Cc: Theodore Tso <tytso@....edu>, Andi Kleen <andi@...stfloor.org>,
Johannes Berg <johannes@...solutions.net>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Linux Kernel list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] add b+tree library
On Sat, 10 Jan 2009 23:01:35 +0100 J__rn Engel <joern@...fs.org> wrote:
> One key difference is that rbtrees maintain the tree within objects and
> btrees maintain the tree externally. So btrees have to allocate memory
> on insertion, where rbtrees have the necessary memory as part of the
> object.
This is a major disadvantage of the btrees.
See all the hoops we ended up jumping through with things like
radix_tree_preload() and idr_pre_get().
The IDR code there wasn't very well designed and still has holes. The
radix-tree code afaik is solid, but look at all the stuff it does!
> With mempools the memory allocation should be reasonably safe,
> so maybe this is a bit of a red herring now.
No, mempools won't help, particularly if items are being added from
atomic contexts.
This is a major major shortcoming which greatly limits the usefulness
of btrees and which greatly reduces the chances of anyone migrating any
rbtree users over to btrees.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists