[patch] remove direct mem_map refs for x86-64

From: Matt Tolentino
Date: Wed Nov 03 2004 - 11:28:02 EST


Hi Andi,

No real functional change here. Just use the pfn_to_page
macros instead of directly indexing into the mem_map.
Patch is against 2.6.10-rc1-mm2. Please consider...

matt

Signed-off-by: Matt Tolentino <matthew.e.tolentino@xxxxxxxxx>

This removes all but one direct reference to mem_map
for x86-64. This is needed on systems where we
break the mem_map up and directly indexing into
mem_map to get the page structure doesn't work anymore.


diff -urN linux-2.6.10-rc1-mm2-vanilla/arch/x86_64/mm/init.c linux-2.6.10-rc1-mm2/arch/x86_64/mm/init.c
--- linux-2.6.10-rc1-mm2-vanilla/arch/x86_64/mm/init.c 2004-11-03 06:40:21.501214144 -0500
+++ linux-2.6.10-rc1-mm2/arch/x86_64/mm/init.c 2004-11-03 06:20:34.000000000 -0500
@@ -68,8 +68,8 @@

for_each_pgdat(pgdat) {
for (i = 0; i < pgdat->node_spanned_pages; ++i) {
- page = pgdat->node_mem_map + i;
- total++;
+ page = pfn_to_page(pgdat->node_start_pfn + i);
+ total++;
if (PageReserved(page))
reserved++;
else if (PageSwapCache(page))
@@ -466,7 +466,7 @@
/*
* Only count reserved RAM pages
*/
- if (page_is_ram(tmp) && PageReserved(mem_map+tmp))
+ if (page_is_ram(tmp) && PageReserved(pfn_to_page(tmp)))
reservedpages++;
#endif

-
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/