Re: 2.6.17-mm1

From: Mel Gorman
Date: Mon Jun 26 2006 - 06:36:15 EST


On Mon, 26 Jun 2006, Franck Bui-Huu wrote:

Hi Mel

Mel Gorman wrote:
On Fri, 23 Jun 2006, Franck Bui-Huu wrote:


[snip]


-unsigned long __init init_bootmem (unsigned long start, unsigned long
pages)
+unsigned long __init init_bootmem(unsigned long start, unsigned long
pages)
{
max_low_pfn = pages;
min_low_pfn = start;
- return(init_bootmem_core(NODE_DATA(0), start, 0, pages));
+ return init_bootmem_core(NODE_DATA(0), start, ARCH_PFN_OFFSET,
pages);
}


Not all arches will use init_bootmem(). Arm for example uses
init_bootmem_node(). ARCH_PFN_OFFSET is only meant to affect mem_map,

well, I don't agree here. ARCH_PFN_OFFSET is used to save the first
page number that has physical memory. I don't see why we couldn't use
it to correctly initialise the memory system...


Architectures will not always have a known fixed start of physical memory. On IA64 at least, they initialise memory as if it starts at 0 but on my one test machine, the beginning part is always a memory hole. I've seen nothing to indicate that this hole will be the same size on all IA64 machines but I kinda doubt it. Also, arches that use init_bootmem() do not necessary use free_area_init().

If we don't change init_bootmem() to use ARCH_PFN_OFFSET, then the
kernel will initialise the start of memory to 0 which is boggus.
IOW,
we can't use this function without this change (except if your memory
start at 0 of course). And I think that init_bootmem() has been
implemented for systems which have only one node _whatever_ memory
start value...


While you may be right, it'll only fix the problem for arches with ARCH_PFN_OFFSET and using init_bootmem (which is the case of MIPS I guess). But arches using init_bootmem_node or not using free_area_init() may still get kicked.

#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
diff --git a/mm/page_alloc.c b/mm/page_alloc.c

[snip]

@@ -2174,8 +2181,7 @@ #endif

void __init free_area_init(unsigned long *zones_size)
{
- free_area_init_node(0, NODE_DATA(0), zones_size,
- __pa(PAGE_OFFSET) >> PAGE_SHIFT, NULL);
+ free_area_init_node(0, NODE_DATA(0), zones_size, ARCH_PFN_OFFSET,
NULL);
}


Same comment applies as for init_bootmem(). I can't be sure it's a good
idea.


same comment as for init_bootmem()


Franck


--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/