On 02/23/2012 04:56 PM, Andrew Morton wrote:
We've been playing whack-a-mole with this search for many years. What about developing a proper data structure with which to locate a suitable-sized hole in O(log(N)) time?
I got around to looking at this, and the more I look, the worse things get. The obvious (and probably highest reasonable complexity) solution looks like this: struct free_area { unsigned long address; struct rb_node rb_addr; unsigned long size; struct rb_node rb_size; }; This works in a fairly obvious way for normal mmap and munmap calls, inserting the free area into the tree at the desired location, or expanding one that is already there. However, it totally falls apart when we need to get aligned areas, for eg. hugetlb or cache coloring on architectures with virtually indexed caches. For those kinds of allocations, we are back to tree walking just like today, giving us a fairly large amount of additional complexity for no obvious gain. Is this really the path we want to go down? -- All rights reversed -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>