[lkml]   [2001]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [RFC] bootmem for 2.5
On Fri, Nov 02, 2001 at 02:02:07PM -0800, William Irwin wrote:
> A number of people have expressed a wish to replace the bitmap-based
> bootmem allocator with one that tracks ranges explicitly. I have
> written such a replacement in order to deal with some of the situations
> I have encountered.

My apologies, I found a logic error in free_all_bootmem_core() which
was not triggered during testing, but deserves correction, in addition
to a leak introduced during verbosity reduction. Without
CONFIG_KERNEL_HACKING the segment pool would be leaked, and also
free_bootmem_core() may invalidate the value of
pgdat->bdata->segment_tree.length_tree read prior to calling it.
This fix was tested on i386.

--- linux.wrong/mm/bootmem.c Fri Nov 2 19:11:41 2001
+++ linux/mm/bootmem.c Fri Nov 2 19:12:23 2001
@@ -659,23 +659,25 @@
unsigned long total = 0UL, mapstart, start, end;
unsigned long node_start = pgdat->bdata->node_boot_start >> PAGE_SHIFT;
struct page *page;
- treap_node_t *parent, *tmp = pgdat->bdata->segment_tree.length_tree;
+ treap_node_t *parent, *tmp;

mapstart = virt_to_phys(pgdat->bdata->node_bootmem_map);


printk("Available physical memory:\n");
- free_bootmem_core(pgdat->bdata, mapstart,
- RND_UP(NR_SEGMENTS*sizeof(segment_buf_t), PAGE_SIZE));


+ free_bootmem_core(pgdat->bdata, mapstart,
+ RND_UP(NR_SEGMENTS*sizeof(segment_buf_t), PAGE_SIZE));
* Destructive post-order traversal of the length tree.
* The tree is never used again, so no attempt is made
* to restore it to working order.
+ tmp = pgdat->bdata->segment_tree.length_tree;
while(tmp) {
segment_tree_node_t *segment = length_segment_treap(tmp);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2005-03-22 13:12    [W:0.073 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site