[PATCH 3/3] x86: use the generic page_is_ram()

From: Wu Fengguang
Date: Thu Jan 21 2010 - 22:31:24 EST


The generic resource based page_is_ram() works better with memory
hotplug/hotremove. So switch the x86 e820map based code to it.

CC: Andi Kleen <andi@xxxxxxxxxxxxxx>
CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
CC: Yinghai Lu <yinghai@xxxxxxxxxx>
Signed-off-by: Wu Fengguang <fengguang.wu@xxxxxxxxx>
---
arch/x86/include/asm/page_types.h | 1 -
arch/x86/mm/ioremap.c | 21 ---------------------
2 files changed, 22 deletions(-)

--- linux-mm.orig/arch/x86/include/asm/page_types.h 2010-01-22 11:20:29.000000000 +0800
+++ linux-mm/arch/x86/include/asm/page_types.h 2010-01-22 11:20:39.000000000 +0800
@@ -40,7 +40,6 @@

#ifndef __ASSEMBLY__

-extern int page_is_ram(unsigned long pagenr);
extern int devmem_is_allowed(unsigned long pagenr);

extern unsigned long max_low_pfn_mapped;
--- linux-mm.orig/arch/x86/mm/ioremap.c 2010-01-22 11:20:37.000000000 +0800
+++ linux-mm/arch/x86/mm/ioremap.c 2010-01-22 11:20:39.000000000 +0800
@@ -24,27 +24,6 @@

#include "physaddr.h"

-int page_is_ram(unsigned long pagenr)
-{
- resource_size_t addr, end;
- int i;
-
- for (i = 0; i < e820.nr_map; i++) {
- /*
- * Not usable memory:
- */
- if (e820.map[i].type != E820_RAM)
- continue;
- addr = (e820.map[i].addr + PAGE_SIZE-1) >> PAGE_SHIFT;
- end = (e820.map[i].addr + e820.map[i].size) >> PAGE_SHIFT;
-
-
- if ((pagenr >= addr) && (pagenr < end))
- return 1;
- }
- return 0;
-}
-
/*
* Fix up the linear direct mapping of the kernel to avoid cache attribute
* conflicts.


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