[PATCH] - Make pfn_valid more precise for SGI Altix systems

From: Dean Roe <roe_at_sgi.com>
Date: 2005-11-10 07:25:06
A single SGI Altix system can be divided into multiple partitions,
each running their own instance of the Linux kernel.  pfn_valid()
is currently not optimal for any but the first partition, since it
does not compare the pfn with min_low_pfn before calling the more
costly ia64_pfn_valid().

	Signed-off-by: Dean Roe <roe@sgi.com>



Index: linux-ia64-test/arch/ia64/kernel/ia64_ksyms.c
===================================================================
--- linux-ia64-test.orig/arch/ia64/kernel/ia64_ksyms.c	2005-11-09 14:10:17.473464250 -0600
+++ linux-ia64-test/arch/ia64/kernel/ia64_ksyms.c	2005-11-09 14:10:50.800226042 -0600
@@ -42,6 +42,7 @@
 
 #ifdef CONFIG_VIRTUAL_MEM_MAP
 #include <linux/bootmem.h>
+EXPORT_SYMBOL(min_low_pfn);	/* defined by bootmem.c, but not exported by generic code */
 EXPORT_SYMBOL(max_low_pfn);	/* defined by bootmem.c, but not exported by generic code */
 #endif
 
Index: linux-ia64-test/include/asm-ia64/page.h
===================================================================
--- linux-ia64-test.orig/include/asm-ia64/page.h	2005-11-09 14:10:17.484205369 -0600
+++ linux-ia64-test/include/asm-ia64/page.h	2005-11-09 14:10:50.803155438 -0600
@@ -112,8 +112,9 @@
 # define pfn_to_page(pfn)	(mem_map + (pfn))
 #elif defined(CONFIG_DISCONTIGMEM)
 extern struct page *vmem_map;
+extern unsigned long min_low_pfn;
 extern unsigned long max_low_pfn;
-# define pfn_valid(pfn)		(((pfn) < max_low_pfn) && ia64_pfn_valid(pfn))
+# define pfn_valid(pfn)		(((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn) && ia64_pfn_valid(pfn))
 # define page_to_pfn(page)	((unsigned long) (page - vmem_map))
 # define pfn_to_page(pfn)	(vmem_map + (pfn))
 #endif

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Thu Nov 10 07:27:58 2005

This archive was generated by hypermail 2.1.8 : 2005-11-10 07:28:05 EST