lkml.org 
[lkml]   [2008]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: + bootmem-node-setup-agnostic-free_bootmem.patch added to -mm tree
Date
Hi Ingo,

Ingo Molnar <mingo@elte.hu> writes:

> * akpm@linux-foundation.org <akpm@linux-foundation.org> wrote:
>
>> Subject: bootmem: node-setup agnostic free_bootmem()
>> From: Johannes Weiner <hannes@saeurebad.de>
>>
>> Make free_bootmem() look up the node holding the specified address
>> range which lets it work transparently on single-node and multi-node
>> configurations.
>
> this patch does not fix the bug Yinghai's (now dropped) patches solved:
> reserve_early() allocations. So NAK until the full problem has been
> sorted out ...

Okay, NAK on -mm and -x86 for sure. The patch was meant for mainline
where there is no need for free_bootmem() going across nodes, right?

But I still object to the way Yinghai implemented it.
free_bootmem_core() should not be twisted like this.

How about the following (untested, even uncompiled, but you should get
the idea) proposal which would replace the patch discussed in this
thread:

--- tree-linus.orig/mm/bootmem.c
+++ tree-linus/mm/bootmem.c
@@ -421,7 +421,25 @@ int __init reserve_bootmem(unsigned long

void __init free_bootmem(unsigned long addr, unsigned long size)
{
- free_bootmem_core(NODE_DATA(0)->bdata, addr, size);
+ bootmem_data_t *bdata;
+
+ list_for_each_entry(bdata, &bdata_list, list) {
+ unsigned long remainder = 0;
+
+ if (addr < bdata->node_boot_start)
+ continue;
+
+ if (PFN_DOWN(addr + size) > bdata->node_low_pfn)
+ remainder = PFN_DOWN(addr + size) - bdata->node_low_pfn;
+
+ size -= PFN_PHYS(remainder);
+ free_bootmem_core(bdata, addr, size)
+
+ if (!remainder)
+ break;
+
+ addr = PFN_PHYS(bdata->node_low_pfn + 1);
+ }
}

unsigned long __init free_all_bootmem(void)
---
Hannes

\
 
 \ /
  Last update: 2008-04-15 14:55    [W:0.087 / U:1.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site