On Wed, Mar 09, 2005 at 10:58:33PM -0800, Andrew Morton wrote:
> Everyone OK with this?
Since I don't understand VM and he's touching everything except my port,
no ;-P
> From: Dave Hansen <[EMAIL PROTECTED]>
> The following patch does what my first one did (don't pass mem_map into the
> init functions), incorporates Jesse Barnes' ia64 fixes on top of that, and
> gets rid of all but one of the global mem_map initializations (parisc is
> weird). It also magically removes more code than it adds. It could be
> smaller, but I shamelessly added some comments.
I'm not quite sure why parisc is 'weird'. Here's the code block in question:
void __init mem_init(void)
{
high_memory = __va((max_pfn << PAGE_SHIFT));
#ifndef CONFIG_DISCONTIGMEM
max_mapnr = page_to_pfn(virt_to_page(high_memory - 1)) + 1;
mem_map = zone_table[ZONE_DMA]->zone_mem_map;
totalram_pages += free_all_bootmem();
#else
{
int i;
for (i = 0; i < npmem_ranges; i++)
totalram_pages += free_all_bootmem_node(NODE_DATA(i));
}
#endif
Something that may not be intuitively obvious to someone with i386 biases
is that on PA-RISC (at least in the case of CONFIG_DISCONTIGMEM=n), all
memory is in ZONE_DMA. Does that help divine what the right answer is
for parisc?
Randolph, you touched this code last ... can you help Dave understand it?
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain